Documentation ¶
Index ¶
- Variables
- type Container
- type CreateBlobInfo
- type CreatedEventData
- type Options
- func (opts *Options) AddProvider(providerType ProviderType, provider Provider) *Options
- func (opts *Options) DefaultProvider() Provider
- func (opts *Options) GetConfig(t ProviderType, key string) any
- func (opts *Options) GetProvider(providerType ProviderType) Provider
- func (opts *Options) Handlers() []SavedHandleFunc
- func (opts *Options) OnSaved(handler SavedHandleFunc) *Options
- func (opts *Options) SetDefaultProvider(provider Provider) *Options
- type Provider
- type ProviderType
- type SaveResult
- type SavedHandleFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrProviderNotFound = errors.New("blob provider not found")
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
func NewBlobContainer ¶
func NewBlobContainer() *Container
func (*Container) Save ¶
func (c *Container) Save(ctx context.Context, b *CreateBlobInfo) (*SaveResult, error)
type CreateBlobInfo ¶
type CreatedEventData ¶
type CreatedEventData struct { Path string `json:"fileName"` Size int64 `json:"size"` Result *SaveResult }
type Options ¶
type Options struct { // UseDefaultProvider if true, then if provider not found, default provider will be used // default value is true UserDefaultProvider bool ProvidersConfig map[ProviderType]map[string]any `mapstructure:"Providers"` // contains filtered or unexported fields }
func NewOptions ¶
func NewOptions() *Options
func (*Options) AddProvider ¶
func (opts *Options) AddProvider(providerType ProviderType, provider Provider) *Options
func (*Options) DefaultProvider ¶
func (*Options) GetProvider ¶
func (opts *Options) GetProvider(providerType ProviderType) Provider
func (*Options) Handlers ¶
func (opts *Options) Handlers() []SavedHandleFunc
func (*Options) OnSaved ¶
func (opts *Options) OnSaved(handler SavedHandleFunc) *Options
func (*Options) SetDefaultProvider ¶
type Provider ¶
type Provider interface {
Save(ctx context.Context, b *CreateBlobInfo) (*SaveResult, error)
}
type ProviderType ¶
type ProviderType string
type SaveResult ¶
type SaveResult struct {
Url string `json:"url"`
}
type SavedHandleFunc ¶
type SavedHandleFunc func(ctx context.Context, b *CreatedEventData) error
Click to show internal directories.
Click to hide internal directories.