Documentation ¶
Index ¶
- Constants
- func TestAwsS3Error(code, op, msg string) error
- func WithCacheRefresh(refresh bool) s3Option
- func WithEndpoint(with string) s3Option
- type S3API
- type StorageAttributes
- type StoragePlugin
- func (p *StoragePlugin) DeleteObjects(ctx context.Context, req *pb.DeleteObjectsRequest) (*pb.DeleteObjectsResponse, error)
- func (p *StoragePlugin) GetObject(req *pb.GetObjectRequest, stream pb.StoragePluginService_GetObjectServer) error
- func (p *StoragePlugin) HeadObject(ctx context.Context, req *pb.HeadObjectRequest) (*pb.HeadObjectResponse, error)
- func (p *StoragePlugin) OnCreateStorageBucket(ctx context.Context, req *pb.OnCreateStorageBucketRequest) (*pb.OnCreateStorageBucketResponse, error)
- func (p *StoragePlugin) OnDeleteStorageBucket(ctx context.Context, req *pb.OnDeleteStorageBucketRequest) (*pb.OnDeleteStorageBucketResponse, error)
- func (p *StoragePlugin) OnUpdateStorageBucket(ctx context.Context, req *pb.OnUpdateStorageBucketRequest) (*pb.OnUpdateStorageBucketResponse, error)
- func (p *StoragePlugin) PutObject(ctx context.Context, req *pb.PutObjectRequest) (*pb.PutObjectResponse, error)
- func (p *StoragePlugin) ValidatePermissions(ctx context.Context, req *pb.ValidatePermissionsRequest) (*pb.ValidatePermissionsResponse, error)
Constants ¶
const (
// ConstAwsEndpointUrl is the key for the endpoint url in the aws s3 client.
ConstAwsEndpointUrl = "endpoint_url"
)
Variables ¶
This section is empty.
Functions ¶
func TestAwsS3Error ¶ added in v0.4.0
TestAwsS3Error returns an s3 api error
func WithCacheRefresh ¶ added in v0.4.1
func WithCacheRefresh(refresh bool) s3Option
WithCacheRefresh controls if the cache should be forced to refresh
func WithEndpoint ¶
func WithEndpoint(with string) s3Option
WithEndpoint contains the endpoint to use
Types ¶
type S3API ¶
type S3API interface { DeleteObject(ctx context.Context, params *s3.DeleteObjectInput, optFns ...func(*s3.Options)) (*s3.DeleteObjectOutput, error) GetObject(ctx context.Context, params *s3.GetObjectInput, optFns ...func(*s3.Options)) (*s3.GetObjectOutput, error) HeadObject(ctx context.Context, params *s3.HeadObjectInput, optFns ...func(*s3.Options)) (*s3.HeadObjectOutput, error) PutObject(ctx context.Context, params *s3.PutObjectInput, optFns ...func(*s3.Options)) (*s3.PutObjectOutput, error) DeleteObjects(ctx context.Context, params *s3.DeleteObjectsInput, optFns ...func(*s3.Options)) (*s3.DeleteObjectsOutput, error) ListObjectsV2(ctx context.Context, params *s3.ListObjectsV2Input, optFns ...func(*s3.Options)) (*s3.ListObjectsV2Output, error) Credentials() aws.Credentials }
type StorageAttributes ¶
type StorageAttributes struct { *cred.CredentialAttributes // EndpointUrl is used for configuring how the aws client will resolve requests. EndpointUrl string }
StorageAttributes is a Go-native representation of the Attributes map.
type StoragePlugin ¶
type StoragePlugin struct { pb.UnimplementedStoragePluginServiceServer // contains filtered or unexported fields }
StoragePlugin implements the StoragePluginServiceServer interface for the AWS storage service plugin.
func (*StoragePlugin) DeleteObjects ¶ added in v0.3.0
func (p *StoragePlugin) DeleteObjects(ctx context.Context, req *pb.DeleteObjectsRequest) (*pb.DeleteObjectsResponse, error)
DeleteObjects is used to delete one or many objects from an s3 bucket.
func (*StoragePlugin) GetObject ¶
func (p *StoragePlugin) GetObject(req *pb.GetObjectRequest, stream pb.StoragePluginService_GetObjectServer) error
GetObject is called when retrieving objects from an s3 bucket. GetObject is a blocking call until the stream has been recieved in full.
func (*StoragePlugin) HeadObject ¶
func (p *StoragePlugin) HeadObject(ctx context.Context, req *pb.HeadObjectRequest) (*pb.HeadObjectResponse, error)
HeadObject is called to get the metadata of an object.
func (*StoragePlugin) OnCreateStorageBucket ¶
func (p *StoragePlugin) OnCreateStorageBucket(ctx context.Context, req *pb.OnCreateStorageBucketRequest) (*pb.OnCreateStorageBucketResponse, error)
OnCreateStorageBucket is called when a storage bucket is created.
func (*StoragePlugin) OnDeleteStorageBucket ¶
func (p *StoragePlugin) OnDeleteStorageBucket(ctx context.Context, req *pb.OnDeleteStorageBucketRequest) (*pb.OnDeleteStorageBucketResponse, error)
OnDeleteStorageBucket is called when a storage bucket is deleted.
func (*StoragePlugin) OnUpdateStorageBucket ¶
func (p *StoragePlugin) OnUpdateStorageBucket(ctx context.Context, req *pb.OnUpdateStorageBucketRequest) (*pb.OnUpdateStorageBucketResponse, error)
OnUpdateStorageBucket is called when a storage bucket is updated.
func (*StoragePlugin) PutObject ¶
func (p *StoragePlugin) PutObject(ctx context.Context, req *pb.PutObjectRequest) (*pb.PutObjectResponse, error)
PutObject is called when putting objects into an s3 bucket.
func (*StoragePlugin) ValidatePermissions ¶
func (p *StoragePlugin) ValidatePermissions(ctx context.Context, req *pb.ValidatePermissionsRequest) (*pb.ValidatePermissionsResponse, error)
ValidatePermissions is called to validate the secrets associated with the storage bucket.