storage

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package storage performs authenticated Volcano storage workflows.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ObjectTokenProvider

type ObjectTokenProvider func(context.Context) (string, error)

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

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

func (s Service) DeleteBucket(ctx context.Context, name string) error

DeleteBucket removes one bucket from the current project.

func (Service) DeleteObject

func (s Service) DeleteObject(ctx context.Context, bucketName, path string) error

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) GetBucket

func (s Service) GetBucket(ctx context.Context, name string) (*apiclient.StorageBucket, error)

GetBucket returns one bucket by name.

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) GetStats

func (s Service) GetStats(ctx context.Context) (*apiclient.StorageStats, error)

GetStats returns aggregate storage statistics for the current project.

func (Service) ListBuckets

func (s Service) ListBuckets(ctx context.Context) ([]apiclient.StorageBucket, error)

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.

func (Service) UploadObject

func (s Service) UploadObject(ctx context.Context, bucketName, path, contentType string, content io.Reader) (*apiclient.StorageObject, error)

UploadObject uploads one object to a bucket via a streaming multipart request, reading the body lazily from content.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL