model

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Chars   = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
	Hex     = "0123456789abcdef"
	Length  = 64
	Timeout = 20 * time.Second
)

Variables

View Source
var (
	ErrAuthFiled                         = errors.New("auth uid failed")
	ErrFindUid                           = errors.New("Failed to find the uid")
	ErrWrongDataFormat                   = errors.New("The data format is wrong")
	ErrFieldIsNonexistentInCompareValues = errors.New("CompareValues: field does not exist")
	//ErrFieldIsNonexistentInGenerateBodyOfRequest = errors.New("GenerateBodyOfRequest: field does not exist")
	ErrParseConfig                = errors.New("Failed to parse the configuration")
	ErrUnmarshalBodyOfResponse    = errors.New("Failed to unmarshal the body of the response")
	ErrInvalidRequest             = errors.New("The request is invalid")
	ErrCheckDigest                = errors.New("Failed to check the digest")
	ErrQueryKey                   = errors.New("Failed to query the key")
	ErrKeyIsNonexistent           = errors.New("The key does not exist")
	ErrLoadConfig                 = errors.New("Failed to query the configuration")
	ErrConfigurationIsNonexistent = errors.New("The configuration does not exist")
	ErrHTTPCommunication          = errors.New("A HTTP communication error has occurred")
	ErrInvalidToken               = errors.New("The token is Invalid")
)

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	BasicConfig BasicConfig `yaml:"basic_config"`
	Request     Request     `yaml:"request"`
	Response    Response    `yaml:"response"`
}

type AuthInfo

type AuthInfo struct {
	AppId      string
	Token      string
	Digest     string
	CreateTime int64
}

type AuthRequest

type AuthRequest struct {
	AppId string `json:"appId"`
	Token string `json:"token"`
}

type AuthResponse

type AuthResponse struct {
	Uid string `json:"uid"`
}

type BasicConfig

type BasicConfig struct {
	Method string `yaml:"method"`
	Url    string `yaml:"url"`
}

type GeneralResponse

type GeneralResponse struct {
	Code    int         `json:"code"`
	Message int         `json:"message"`
	Data    interface{} `json:"data"`
}

type Request

type Request struct {
	TokenName string `yaml:"token_name"`
}

type Response

type Response struct {
	//ContentType   string                      `yaml:"content_type"`
	UidName       string                      `yaml:"uid_name"`
	SuccessResult map[interface{}]interface{} `yaml:"success_result"`
}

type SignInInfo

type SignInInfo struct {
	AppId      string
	ConfigFile *multipart.FileHeader
	CreateTime int64
	UpdateTime int64
}

type SignInRequest

type SignInRequest struct {
	AppId      string                `json:"appId" form:"appId"`
	ConfigFile *multipart.FileHeader `json:"-" form:"-"`
}

type SignInResponse

type SignInResponse struct {
	AppId      string `json:"appId"`
	Key        string `json:"key"`
	CreateTime int64  `json:"createTime"`
	UpdateTime int64  `json:"updateTime"`
}

Jump to

Keyboard shortcuts

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