Documentation
¶
Index ¶
- func AvailableModules() map[string]Module
- func ContentTypeInList(contentType string, contentTypeList []string) bool
- func ModuleConfigSkeletons() map[string]any
- func ModuleNames() []string
- func RegisterModule(serviceName string, module Module)
- func UnmarshalModuleConfigFromYaml(conf any) map[string]any
- type Config
- type Module
- type Object
- type Service
- type ServiceConfig
- type Store
- func (mediaStore *Store) Download(sourceKey string) (buffer *bytes.Buffer, err error)
- func (mediaStore *Store) GenerateName(stream io.Reader) string
- func (mediaStore *Store) GetPublicURL(sourceKey string) (publicURL string, err error)
- func (mediaStore *Store) Upload(mediaName string, contentSource io.Reader, mediaType media.MediaType) (uploadInfo *UploadInfo, err error)
- type UploadInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AvailableModules ¶
func ContentTypeInList ¶
func ModuleConfigSkeletons ¶
func ModuleNames ¶
func ModuleNames() []string
func RegisterModule ¶
Types ¶
type Config ¶
type Config struct { NameGenerationKey string `env:"FILENAME_GENERATION_KEY" yaml:"filename_generation_key" json:"filename_generation_key"` StoreService string `env:"STORE_SERVICE" yaml:"store_service" json:"store_service"` Modules map[string]any `env:",map,squash" yaml:",inline,omitempty"` ImagesBaseURL string `env:"IMAGES_BASE_URL" yaml:"images_base_url" json:"images_base_url"` }
func ConfigSkeleton ¶
func ConfigSkeleton() Config
func ParseConfigFromEnv ¶
ParseConfigFromEnv populate the configuration by looking up the environment variables.
type Module ¶
type Module struct { // ServiceConfigSkeleton returns an instance of config used to initialize // the service. This skeleton contains a config structure. ServiceConfigSkeleton func() ServiceConfig // NewService create a storage service backend connection. This is // usually initialize the client of the object storage. NewService func(config ServiceConfig) (Service, error) }
Module contains attributes which describe a storage module.
type Service ¶
type ServiceConfig ¶
type ServiceConfig any
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) GenerateName ¶
GenerateName is used to generate a name, for file or other identifier based on the content. It utilized hash so the result could be used to prevent duplicates when storing the media object
func (*Store) GetPublicURL ¶
Click to show internal directories.
Click to hide internal directories.