Documentation ¶
Index ¶
- type Driver
- type Provider
- type Service
- func (s *Service) Create(ctx context.Context, size int) (types.Volume, error)
- func (s *Service) Delete(ctx context.Context, id string) error
- func (s *Service) Get(ctx context.Context, id string) (types.Volume, error)
- func (s *Service) List(ctx context.Context) ([]types.Volume, error)
- func (s *Service) Mount(ctx context.Context, id, path string) error
- func (s *Service) UnMount(ctx context.Context, id, path string) error
- type Store
- type Volume
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider interface { // Name returns the name of the provider. Name() string // VolumeCreate creates a volume. The size is in GB. VolumeCreate(ctx context.Context, size int) (Volume, error) // VolumeDelete deletes the volume. VolumeDelete(ctx context.Context) error // VolumeGet gets the volume. VolumeGet(ctx context.Context, id string) (Volume, error) // VolumeList lists all volumes the provider has. VolumeList(ctx context.Context) ([]Volume, error) // VolumeResize resizes the volume to the given size in GB. VolumeResize(ctx context.Context, size int) error }
Provider allows management of volumes from different providers (eg AWS, GCP).
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewVolumeService ¶
type Store ¶
type Store interface { Create(namespace string, id, provider string) (types.Volume, error) Get(namespace, id string) (types.Volume, error) List(namespace string) ([]types.Volume, error) Remove(namespace, id string) error Update(namespace string, volume types.Volume) error }
Store is an interface that must be implemented any volume store.
type Volume ¶
type Volume interface { // ID returns the ID of the volume. ID() string // Mount mounts the volume to the given path. Mount(ctx context.Context, path string) error // Unmount unmounts the volume from the given path. Unmount(ctx context.Context, path string) error }
Volume is an interface that must be implemented by a volume. The implementation of the volume interface should have the ability/permissions to mount the volume onto a container inside a node. For instance, this could be an AWS EBS volume mounted onto a container inside an EC2 machine, a FUSE volume on top of S3/GCS, etc.
Click to show internal directories.
Click to hide internal directories.