Documentation
¶
Overview ¶
Package storage performs authenticated Volcano storage workflows.
Index ¶
- type ObjectTokenProvider
- type Option
- type Service
- func (s Service) CopyObject(ctx context.Context, bucketName, from, to string) (*apiclient.StorageObject, error)
- func (s Service) CreateBucket(ctx context.Context, input api.StorageBucketCreateInput) (*apiclient.StorageBucket, error)
- func (s Service) CreatePolicy(ctx context.Context, bucketName string, input api.StoragePolicyCreateInput) (*apiclient.StoragePolicy, error)
- func (s Service) DeleteBucket(ctx context.Context, name string) error
- func (s Service) DeleteObject(ctx context.Context, bucketName, path string) error
- func (s Service) DeletePolicy(ctx context.Context, bucketName, identifier string) (*apiclient.StoragePolicy, error)
- func (s Service) DownloadObject(ctx context.Context, bucketName, path string, w io.Writer) (int64, error)
- func (s Service) GetBucket(ctx context.Context, name string) (*apiclient.StorageBucket, error)
- func (s Service) GetPolicy(ctx context.Context, bucketName, identifier string) (*apiclient.StoragePolicy, error)
- func (s Service) GetStats(ctx context.Context) (*apiclient.StorageStats, error)
- func (s Service) ListBuckets(ctx context.Context) ([]apiclient.StorageBucket, error)
- func (s Service) ListObjects(ctx context.Context, bucketName string, opts api.StorageObjectListOptions) (*apiclient.StorageListResponse, error)
- func (s Service) ListPolicies(ctx context.Context, bucketName string) ([]apiclient.StoragePolicy, error)
- func (s Service) MoveObject(ctx context.Context, bucketName, from, to string) (*apiclient.StorageObject, error)
- func (s Service) SetObjectVisibility(ctx context.Context, bucketName, path string, isPublic bool) (*apiclient.StorageObject, error)
- func (s Service) UpdateBucket(ctx context.Context, name string, input api.StorageBucketUpdateInput) (*apiclient.StorageBucket, error)
- func (s Service) UploadObject(ctx context.Context, bucketName, path, contentType string, content io.Reader) (*apiclient.StorageObject, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ObjectTokenProvider ¶
ObjectTokenProvider returns the bearer token to use for storage object routes. Bucket, policy, and stats workflows continue to use the current user session.
type Option ¶
type Option func(*Service)
Option configures storage workflows.
func WithObjectTokenProvider ¶
func WithObjectTokenProvider(provider ObjectTokenProvider) Option
WithObjectTokenProvider configures the bearer token source for storage object routes.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service performs authenticated Volcano storage workflows.
func NewService ¶
func NewService(deps cliruntime.Deps, opts ...Option) Service
NewService returns a storage service.
func (Service) CopyObject ¶
func (s Service) CopyObject(ctx context.Context, bucketName, from, to string) (*apiclient.StorageObject, error)
CopyObject copies one object within a bucket.
func (Service) CreateBucket ¶
func (s Service) CreateBucket(ctx context.Context, input api.StorageBucketCreateInput) (*apiclient.StorageBucket, error)
CreateBucket creates one bucket in the current project.
func (Service) CreatePolicy ¶
func (s Service) CreatePolicy(ctx context.Context, bucketName string, input api.StoragePolicyCreateInput) (*apiclient.StoragePolicy, error)
CreatePolicy attaches a new policy to a bucket.
func (Service) DeleteBucket ¶
DeleteBucket removes one bucket from the current project.
func (Service) DeleteObject ¶
DeleteObject removes one object from a bucket.
func (Service) DeletePolicy ¶
func (s Service) DeletePolicy(ctx context.Context, bucketName, identifier string) (*apiclient.StoragePolicy, error)
DeletePolicy removes one policy from a bucket by name or UUID.
func (Service) DownloadObject ¶
func (s Service) DownloadObject(ctx context.Context, bucketName, path string, w io.Writer) (int64, error)
DownloadObject streams one object body into the writer and returns its size.
func (Service) GetPolicy ¶
func (s Service) GetPolicy(ctx context.Context, bucketName, identifier string) (*apiclient.StoragePolicy, error)
GetPolicy returns one policy attached to a bucket by name or UUID. The Volcano API does not expose a single-policy fetch endpoint, so this client-side filter walks the bucket's policy list.
func (Service) ListBuckets ¶
ListBuckets returns every bucket in the current project.
func (Service) ListObjects ¶
func (s Service) ListObjects(ctx context.Context, bucketName string, opts api.StorageObjectListOptions) (*apiclient.StorageListResponse, error)
ListObjects returns one cursor page of objects in a bucket.
func (Service) ListPolicies ¶
func (s Service) ListPolicies(ctx context.Context, bucketName string) ([]apiclient.StoragePolicy, error)
ListPolicies returns every policy attached to a bucket.
func (Service) MoveObject ¶
func (s Service) MoveObject(ctx context.Context, bucketName, from, to string) (*apiclient.StorageObject, error)
MoveObject renames one object within a bucket.
func (Service) SetObjectVisibility ¶
func (s Service) SetObjectVisibility(ctx context.Context, bucketName, path string, isPublic bool) (*apiclient.StorageObject, error)
SetObjectVisibility updates the public/private flag on one object.
func (Service) UpdateBucket ¶
func (s Service) UpdateBucket(ctx context.Context, name string, input api.StorageBucketUpdateInput) (*apiclient.StorageBucket, error)
UpdateBucket updates one bucket's configuration.