MCPcopy
hub / github.com/LyricTian/gin-admin / RemoveObject

Method RemoveObject

pkg/oss/s3.go:106–119  ·  view source on GitHub ↗
(ctx context.Context, bucketName, objectName string)

Source from the content-addressed store, hash-verified

104}
105
106func (c *S3Client) RemoveObject(ctx context.Context, bucketName, objectName string) error {
107 if bucketName == "" {
108 bucketName = c.config.BucketName
109 }
110
111 objectName = formatObjectName(c.config.Prefix, objectName)
112 input := &s3.DeleteObjectInput{
113 Bucket: aws.String(bucketName),
114 Key: aws.String(objectName),
115 }
116
117 _, err := c.client.DeleteObject(input)
118 return err
119}
120
121func (c *S3Client) RemoveObjectByURL(ctx context.Context, urlStr string) error {
122 prefix := c.config.Domain + "/"

Callers

nothing calls this directly

Calls 2

formatObjectNameFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected