model

package
v0.2.18 Latest Latest
Warning

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

Go to latest
Published: May 11, 2019 License: Apache-2.0 Imports: 0 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterModel

func RegisterModel(config Config)

Types

type AppIdAndChannelConfigMap

type AppIdAndChannelConfigMap map[string]AppIdAndChannelConfigs

################## appid ##################

func (*AppIdAndChannelConfigMap) ConfigType

func (g *AppIdAndChannelConfigMap) ConfigType() ConfigType

func (*AppIdAndChannelConfigMap) DirName

func (g *AppIdAndChannelConfigMap) DirName() string

type AppIdAndChannelConfigs

type AppIdAndChannelConfigs struct {
	AppId          string               `json:"app_id"`
	ChannelConfigs []AppIdChannelConfig `json:"channel_configs"`
}

type AppIdChannelConfig

type AppIdChannelConfig struct {
	RatePercent    float32 `json:"rate_percent"`
	Method         string  `json:"method"`
	ChannelAccount string  `json:"channel_account"`
	Available      bool    `json:"available"`
	ChannelId      string  `json:"channel_id"`
}

type BaseConfig

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

func (*BaseConfig) BaseDir

func (b *BaseConfig) BaseDir() string

func (*BaseConfig) FullPath

func (b *BaseConfig) FullPath() string

func (*BaseConfig) Key

func (b *BaseConfig) Key() string

type ChannelServiceConfig

type ChannelServiceConfig struct {
	BaseConfig
	ChannelId   string `json:"channel_id"`
	ServiceName string `json:"service_name"`
	Host        string `json:"host"`
	Port        int    `json:"port"`
}

type ChannelServiceConfigMap

type ChannelServiceConfigMap map[string]ChannelServiceConfig

################## channel ##################

func (*ChannelServiceConfigMap) ConfigType

func (g *ChannelServiceConfigMap) ConfigType() ConfigType

func (*ChannelServiceConfigMap) DirName

func (g *ChannelServiceConfigMap) DirName() string

type Config

type Config interface {
	DirName() string
	ConfigType() ConfigType
}

type ConfigType

type ConfigType string
var (
	// 数组的形式,存储为key/model的形式,即:如果在key目录下新增对象,则会解析成map,
	MAP ConfigType = "MAP"
	// 对象的形式,会将设置反序列化为对象
	MODEL ConfigType = "MODEL"
)

type MerchantConfig

type MerchantConfig struct {
	AppId                string `json:"app_id"`
	GatewayRSAPublicKey  string `json:"gateway_rsa_public_key"`
	GatewayRSAPrivateKey string `json:"gateway_rsa_private_key"`
	MerchantRSAPublicKey string `json:"merchant_rsa_public_key"`
	Md5Key               string `json:"md5_key"`
}

type MerchantConfigMap

type MerchantConfigMap map[string]MerchantConfig

func (*MerchantConfigMap) ConfigType

func (g *MerchantConfigMap) ConfigType() ConfigType

func (*MerchantConfigMap) DirName

func (g *MerchantConfigMap) DirName() string

type NoticeConfig

type NoticeConfig struct {
	NoticeIntervalSecond int `json:"notice_interval_second"`
	// 通知间隔
	//
	// 例如: [30, 30, 120, 240, 480, 1200, 3600, 7200, 43200, 86400, 172800]
	// 表示如果通知失败,则会隔 30s, 30s, 2min, 4min, 8min, 20min, 1H, 2H, 12H, 24H, 48H 通知
	NoticeDelaySecondExpressions []int `json:"notice_expressions"`
}

################## notice ##################

func (*NoticeConfig) ConfigType

func (g *NoticeConfig) ConfigType() ConfigType

func (*NoticeConfig) DirName

func (g *NoticeConfig) DirName() string

type PayConfig

type PayConfig struct {
	ClusterId   *string `json:"cluster_id"`
	Concurrency int     `json:"concurrency"`
	// 通知地址的正则,必须包含{gateway_order_id}
	NotifyUrlPattern string `json:"notify_url_pattern"`
	// 跳转地址的正则,必须包含{gateway_order_id}
	ReturnUrlPattern string `json:"return_url_pattern"`
}

func (*PayConfig) ConfigType

func (g *PayConfig) ConfigType() ConfigType

func (*PayConfig) DirName

func (g *PayConfig) DirName() string

type PersonalMerchant

type PersonalMerchant struct {
	AppId                string `json:"app_id"`
	GatewayRSAPublicKey  string `json:"gateway_rsa_public_key"`
	GatewayRSAPrivateKey string `json:"gateway_rsa_private_key"`
	MerchantRSAPublicKey string `json:"merchant_rsa_public_key"`
	Md5Key               string `json:"md5_key"`
}

type PersonalMerchantConfigMap

type PersonalMerchantConfigMap map[string]PersonalMerchant

################## personal merchant ##################

func (*PersonalMerchantConfigMap) ConfigType

func (g *PersonalMerchantConfigMap) ConfigType() ConfigType

func (*PersonalMerchantConfigMap) DirName

func (g *PersonalMerchantConfigMap) DirName() string

type ServiceConfig

type ServiceConfig struct {
	ServiceName string `json:"service_name"`
	Host        string `json:"host"`
	Port        int    `json:"port"`
}

type ServiceConfigMap

type ServiceConfigMap map[string]ServiceConfig

################## service ##################

func (*ServiceConfigMap) ConfigType

func (g *ServiceConfigMap) ConfigType() ConfigType

func (*ServiceConfigMap) DirName

func (g *ServiceConfigMap) DirName() string

Jump to

Keyboard shortcuts

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