Documentation
¶
Overview ¶
Package media is a default implementation of cms page related interfaces declared in "github.com/ottemo/commerce/app/models/cms" package
Index ¶
- Constants
- func APIAddMedia(context api.InterfaceApplicationContext) (interface{}, error)
- func APIGetMedia(context api.InterfaceApplicationContext) (interface{}, error)
- func APIGetMediaPath(context api.InterfaceApplicationContext) (interface{}, error)
- func APIListMedia(context api.InterfaceApplicationContext) (interface{}, error)
- func APIRemoveMedia(context api.InterfaceApplicationContext) (interface{}, error)
Constants ¶
View Source
const ( ConstErrorModule = "cms/media" ConstErrorLevel = env.ConstErrorLevelActor ConstStorageModel = "cms" ConstStorageObject = "media" )
Package global constants
Variables ¶
This section is empty.
Functions ¶
func APIAddMedia ¶
func APIAddMedia(context api.InterfaceApplicationContext) (interface{}, error)
APIAddMedia uploads images to the media
- media file should be provided in "file" field with full name
- the mediaType of files are detected automatically
func APIGetMedia ¶
func APIGetMedia(context api.InterfaceApplicationContext) (interface{}, error)
APIGetMedia returns media from storage
- media name must be specified in "mediaName" argument
- on success case not a JSON data returns, but media file
func APIGetMediaPath ¶
func APIGetMediaPath(context api.InterfaceApplicationContext) (interface{}, error)
APIGetMediaPath returns relative path to media library
- product id, media type must be specified in "productID" and "mediaType" arguments
func APIListMedia ¶
func APIListMedia(context api.InterfaceApplicationContext) (interface{}, error)
APIListMedia returns list of media files from media
- if mediaType is empty - all types will be used
- if mediaType is explicit value - only this value will be used
- if mediaType is list of types separated by comma - only these types will be shown
func APIRemoveMedia ¶
func APIRemoveMedia(context api.InterfaceApplicationContext) (interface{}, error)
APIRemoveMedia removes media from storage
- media name must be specified in "mediaName" argument
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.