Documentation ¶
Index ¶
- Variables
- func ListenAndServePlugin(store Store, logger hclog.Logger)
- func MetadataMapToPluginProtoMap(mmap metadata.CfileMetadataMap) map[string]*pluginproto.ObjectMetadata
- func PluginProtoMapToMetadataMap(ppm *pluginproto.ObjectsAndMetadataMap) metadata.CfileMetadataMap
- type AzureBlobStore
- func (s *AzureBlobStore) Close() error
- func (s *AzureBlobStore) GetFsys() (afero.Fs, error)
- func (s *AzureBlobStore) GetOptions() (Options, error)
- func (s *AzureBlobStore) Retrieve(ctx context.Context, objects ...string) error
- func (s *AzureBlobStore) Upload(ctx context.Context, objects ...string) error
- type GCSStore
- type Options
- type PluggableStore
- type S3Downloader
- type S3Store
- func (s *S3Store) Close() error
- func (s *S3Store) GetFsys() (afero.Fs, error)
- func (s *S3Store) GetOptions() (Options, error)
- func (s *S3Store) Retrieve(ctx context.Context, mmap metadata.CfileMetadataMap, cfiles ...string) error
- func (s *S3Store) Upload(ctx context.Context, objects ...string) error
- type S3Uploader
- type Store
- type StoreType
- type StoreWithGetters
Constants ¶
This section is empty.
Variables ¶
View Source
var ( PluginSet = plugin.PluginSet{ "store": &storePlugin{}, } HandshakeConfig = plugin.HandshakeConfig{ ProtocolVersion: 1, MagicCookieKey: "BASIC_PLUGIN", MagicCookieValue: "cavorite", } // FIXME: make configurable? HLog = hclog.New(&hclog.LoggerOptions{ Name: "plugin", Output: os.Stdout, Level: hclog.Debug, }) )
View Source
var (
ErrCfilesLengthZero = errors.New("at least one cfile must be specified")
)
View Source
var ErrMetadataFileExtensionEmpty = fmt.Errorf("options.MetadatafileExtension cannot be %q", "")
Functions ¶
func ListenAndServePlugin ¶
func ListenAndServePlugin(store Store, logger hclog.Logger)
ListenAndServePlugin is used by plugins to start listening to requests
func MetadataMapToPluginProtoMap ¶
func MetadataMapToPluginProtoMap(mmap metadata.CfileMetadataMap) map[string]*pluginproto.ObjectMetadata
func PluginProtoMapToMetadataMap ¶
func PluginProtoMapToMetadataMap(ppm *pluginproto.ObjectsAndMetadataMap) metadata.CfileMetadataMap
Types ¶
type AzureBlobStore ¶
type AzureBlobStore struct { Options Options // contains filtered or unexported fields }
func NewAzureBlobStore ¶
func NewAzureBlobStore(ctx context.Context, fsys afero.Fs, storeOpts Options, azureBlobOptions azblob.ClientOptions) (*AzureBlobStore, error)
func (*AzureBlobStore) Close ¶
func (s *AzureBlobStore) Close() error
func (*AzureBlobStore) GetOptions ¶
func (s *AzureBlobStore) GetOptions() (Options, error)
type GCSStore ¶
type GCSStore struct { Options Options `mapstructure:"options"` // contains filtered or unexported fields }
func NewGCSStoreClient ¶
NewGCSStoreClient creates a GCS Storage Client utilizing either the default GOOGLE_APPLICATION_CREDENTIAL env var or a json string env var named CAVORITE_GCS_CREDENTIALS
func (*GCSStore) GetOptions ¶
type Options ¶
type Options struct { BackendAddress string `json:"backend_address" mapstructure:"backend_address"` PluginAddress string `json:"plugin_address,omitempty" mapstructure:"plugin_address"` MetadataFileExtension string `json:"metadata_file_extension" mapstructure:"metadata_file_extension"` Region string `json:"region" mapstructure:"region"` /* If ObjectKeyPrefix is set to "team-bucket", and the initialized backend supports it, - `cavorite upload whatever/thing` will be written to `team-bucket/whatever/thing` - `cavorite retrieve whatever/thing` will request `team-bucket/whatever/thing` */ ObjectKeyPrefix string `json:"object_key_prefix,omitempty" mapstructure:"object_key_prefix"` }
type PluggableStore ¶
type PluggableStore struct { Store // contains filtered or unexported fields }
PluggableStore is the Store used by cavorite that wraps go-plugin
func NewPluggableStore ¶
func NewPluggableStore(_ context.Context, opts Options) (*PluggableStore, error)
func (*PluggableStore) Close ¶
func (p *PluggableStore) Close() error
type S3Downloader ¶
type S3Downloader interface { Download( ctx context.Context, w io.WriterAt, input *s3.GetObjectInput, options ...func(*s3manager.Downloader)) (n int64, err error) }
type S3Store ¶
type S3Store struct { Options Options `json:"options" mapstructure:"options"` // contains filtered or unexported fields }
func NewS3Store ¶
func (*S3Store) GetOptions ¶
type S3Uploader ¶
type S3Uploader interface { Upload(ctx context.Context, input *s3.PutObjectInput, opts ...func(*s3manager.Uploader)) ( *s3manager.UploadOutput, error, ) }
Click to show internal directories.
Click to hide internal directories.