models

package
v0.0.0-...-57214d0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2015 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EmptyString = ""
)

Variables

View Source
var (
	ErrDuplicatedRecord = errors.New("duplicated records exist")
	ErrSizeExisted      = errors.New("size already existed")
	ErrNoRecord         = errors.New("no record found")
	ErrHasBeenModified  = errors.New("Has been modified")

	ERRORTYPE_GETCONFIGS     = "GetConfig"
	ERRORTYPE_CONFIGNOEXISTS = "ConfigNoExists"

	CONFIG_DEFAULTCHANNEL = "00"
	CONFIG_FDFSGROUPS     = "fdfsgroups"
	CONFIG_FDFSPORT       = "fdfsport"
	CONFIG_FDFSDOMAIN     = "fdfsdomain"
	CONFIG_NFS            = "nfs"
	CONFIG_NFST1          = "nfst1"

	SPILT_1 = ","
	SPILT_2 = "|"
)
View Source
var (
	ERRTYPE_IMAGENAMEINVALID   = "ImageNameInvalid"
	ERRTYPE_GETIMAGEINDEX      = "GetImageIndex"
	ERRORTYPE_INSERTIMAGEINDEX = "InsertImageIndex"
	ERRORTYPE_INSERTIMAGEPLAN  = "InsertImagePlan"
	ERRORTYPE_DELETEIMAGEINDEX = "DeleleImageIndex"
	DBTITLE                    = "DB"
	NEWIMAGENAMELENGTH         = 21
	DEFAULTVERSION             = "0"
)
View Source
var (
	ERRORTYPE_GETCHANNEL = "GetChannel"
)
View Source
var (
	KeySizes = "sizes"
)

Functions

func IsRefresh

func IsRefresh(t time.Time) bool

Types

type Channel

type Channel struct {
	Name string
	Code string
	Cat  cat.Cat
}

func (*Channel) GetAll

func (this *Channel) GetAll() (map[string]string, util.Error)

func (*Channel) GetChannelCode

func (this *Channel) GetChannelCode(channelName string) string

func (*Channel) Insert

func (this *Channel) Insert() error

func (*Channel) Update

func (this *Channel) Update() error

type Config

type Config struct {
	//Consistent Fields
	Id          int64 `orm:"auto"`
	ChannelCode string
	Key         string

	//Inconsistent Fields
	Value      string
	Recordtime string
	Cat        cat.Cat
}

func (*Config) AddSize

func (this *Config) AddSize(size string) error

func (*Config) GetChannelConfigs

func (this *Config) GetChannelConfigs(channelCode string) (map[string]string, util.Error)

func (*Config) GetConfigs

func (this *Config) GetConfigs() (map[string]map[string]string, util.Error)

func (*Config) GetFdfsDomain

func (this *Config) GetFdfsDomain() (string, util.Error)

func (*Config) GetFdfsPort

func (this *Config) GetFdfsPort() (string, util.Error)

func (*Config) GetGroups

func (this *Config) GetGroups() ([]string, util.Error)

func (*Config) GetNfsPath

func (this *Config) GetNfsPath(channel string) ([]string, util.Error)

func (*Config) GetNfsT1Path

func (this *Config) GetNfsT1Path(channel string) ([]string, util.Error)

func (*Config) GetSizes

func (this *Config) GetSizes() (string, error)

func (*Config) Insert

func (this *Config) Insert() error

func (*Config) UpdateValue

func (this *Config) UpdateValue() error

type ImageIndex

type ImageIndex struct {
	Id           int64
	ChannelCode  string
	StoragePath  string
	StorageType  string
	Profile      string
	PartitionKey int16
	TableZone    int
	Version      string
	Cat          cat.Cat
}

func (*ImageIndex) Delete

func (this *ImageIndex) Delete() util.Error

func (*ImageIndex) DropExtension

func (this *ImageIndex) DropExtension(imageName string) string

func (ImageIndex) GetImageName

func (this ImageIndex) GetImageName() string

func (*ImageIndex) GetStorage

func (this *ImageIndex) GetStorage() util.Error

func (*ImageIndex) Parse

func (this *ImageIndex) Parse(imageName string) util.Error

func (*ImageIndex) ParseName

func (this *ImageIndex) ParseName(imgName string) util.Error

func (*ImageIndex) SaveToDB

func (this *ImageIndex) SaveToDB(plan string) util.Error

type ImagePlan

type ImagePlan struct {
	ImgIdx       int64
	Plan         string
	PartitionKey int16
	TableZone    int
}

type LogoImage

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

type LogoInfo

type LogoInfo struct {
	Path string
	Name string
}

func (*LogoInfo) MarshalJSON

func (mj *LogoInfo) MarshalJSON() ([]byte, error)

func (*LogoInfo) MarshalJSONBuf

func (mj *LogoInfo) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*LogoInfo) UnmarshalJSON

func (uj *LogoInfo) UnmarshalJSON(input []byte) error

func (*LogoInfo) UnmarshalJSONFFLexer

func (uj *LogoInfo) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

Jump to

Keyboard shortcuts

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