domain

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 15, 2016 License: GPL-2.0 Imports: 21 Imported by: 0

Documentation

Overview

*

  • Copyright 2014 @ z3q.net.
  • name : delivery
  • author : jarryliu
  • date : 2014-10-06 14:21 :
  • description :
  • history :

*

  • Copyright 2015 @ z3q.net.
  • name : download.go
  • author : jarryliu
  • date : 2015-12-31 12:23
  • description :
  • history :

*

  • Copyright 2014 @ z3q.net.
  • name :
  • author : jarryliu
  • date : 2014-02-05 21:53
  • description :
  • history :

*

  • Copyright 2015 @ z3q.net.
  • name : option.go
  • author : jarryliu
  • date : 2016-04-18 13:48
  • description :
  • history :

Index

Constants

View Source
const (
	OptionTypeInt int = iota
	OptionTypeString
	OptionTypeBoolean
)

Variables

This section is empty.

Functions

func BuildOptionsForm

func BuildOptionsForm(v *[]Option) string

func CartCookieFmt

func CartCookieFmt(s string) string

传唤客户端的购物车cookie为服务端的方式.

func ChkPwdRight

func ChkPwdRight(pwd string) (bool, error)

func DownloadToLocal

func DownloadToLocal(partnerId int, url string, guessExt string) string

下载远程资源并返回本地地址

func GenerateCartKey

func GenerateCartKey(unix int64, nano int) string

生成16位唯一的md5购物车码

func GenerateInvitationCode

func GenerateInvitationCode() string

创建邀请码(6位)

func GenerateRandomIntPwd

func GenerateRandomIntPwd(n int) string

创建随机数字密码

func GenerateRandomPwd

func GenerateRandomPwd(n int) string

创建随机密码

func GetAreaName

func GetAreaName(addr string) (string, error)

获取地区名称

func GetCityName

func GetCityName(addr string) (string, error)

获取城市名称

func Md5Pwd

func Md5Pwd(pwd, offset string) string

密码Md5加密

func MemberSha1Pwd

func MemberSha1Pwd(pwd string) string

加密会员密码,因为可能会使用手机号码登陆, 所以密码不能依据用户名作为生成凭据

func NewApiId

func NewApiId(id int) string

创建API编号(10位)

func NewOrderNo

func NewOrderNo(partnerId int) string

新订单号

func NewSecret

func NewSecret(hex int) string

创建密钥(16位)

func NewTradeNo

func NewTradeNo(partnerId int) string

新交易号(12位)

func PartnerSha1Pwd

func PartnerSha1Pwd(usr, pwd string) string

加密合作商密码

func ShaPwd

func ShaPwd(pwd, offset string) string

密码SHA1加密

Types

type DomainError

type DomainError struct {
	Key          string
	DefaultError string
}

func NewDomainError

func NewDomainError(key string, msg string) *DomainError

func (*DomainError) Error

func (this *DomainError) Error() string

func (*DomainError) Set

func (this *DomainError) Set(msg string)

type IOptionStore

type IOptionStore interface {
	// the indent of option store
	Indent() string

	// check state
	Stat() error

	// get all options
	All() (keys []string, values []*Option)

	// get option by key
	Get(key string) (value *Option)

	// after set,call flush()
	Set(key string, value *Option)

	// flush to file
	Flush() error
}

func NewOptionStoreWrapper

func NewOptionStoreWrapper(indent string) IOptionStore

type Option

type Option struct {
	Key   string `json:"key"`   //键
	Type  int    `json:"type"`  //类型
	Must  bool   `json:"must"`  //是否必须填写
	Title string `json:"title"` //标题
	Value string `json:"value"` //值
}

type OptionStoreWrapper

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

func (*OptionStoreWrapper) All

func (this *OptionStoreWrapper) All() (keys []string, values []*Option)

get all options

func (*OptionStoreWrapper) Flush

func (this *OptionStoreWrapper) Flush() (err error)

flush to file

func (*OptionStoreWrapper) Get

func (this *OptionStoreWrapper) Get(key string) *Option

get option by key

func (*OptionStoreWrapper) Indent

func (this *OptionStoreWrapper) Indent() string

the indent of option store

func (*OptionStoreWrapper) Set

func (this *OptionStoreWrapper) Set(key string, v *Option)

after set,call flush()

func (*OptionStoreWrapper) Stat

func (this *OptionStoreWrapper) Stat() error

type OptionType

type OptionType int

Directories

Path Synopsis
*
*

Jump to

Keyboard shortcuts

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