media

package
v1.4.5-alpha1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2019 License: MPL-2.0 Imports: 9 Imported by: 0

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

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.

Jump to

Keyboard shortcuts

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