factories

package
v0.0.0-...-8411d4f Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FactoriesRegister = NewStorageFactoriesRegister()

Functions

func Registry

func Registry(name string, factory StorageFactory)

Types

type Context

type Context struct {
	Var     *stringvar.StringVar
	Options options.Options
}

func NewContext

func NewContext(data ...map[string]interface{}) *Context

type StorageFactoriesRegister

type StorageFactoriesRegister struct {
	// contains filtered or unexported fields
}

func NewStorageFactoriesRegister

func NewStorageFactoriesRegister() *StorageFactoriesRegister

func (*StorageFactoriesRegister) Get

func (r *StorageFactoriesRegister) Get(name string) (factory StorageFactory, ok bool)

func (*StorageFactoriesRegister) Registry

func (r *StorageFactoriesRegister) Registry(name string, factory StorageFactory)

type StorageFactory

type StorageFactory interface {
	Factory(ctx *Context, config map[string]interface{}) (storage oss.StorageInterface, err error)
}

func Get

func Get(name string) (factory StorageFactory, ok bool)

type StorageFactoryFunc

type StorageFactoryFunc func(ctx *Context, config map[string]interface{}) (storage oss.StorageInterface, err error)

func (StorageFactoryFunc) Factory

func (f StorageFactoryFunc) Factory(ctx *Context, config map[string]interface{}) (storage oss.StorageInterface, err error)

Jump to

Keyboard shortcuts

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