auth

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	ISP             string        `yaml:"isp"`               // 即运营商标识 cmpp、sgip、smgp
	ClientId        string        `yaml:"client-id"`         // 即SourceAddr
	SharedSecret    string        `yaml:"shared-secret"`     // 通讯密码
	Version         byte          `yaml:"version"`           // 见CMPP协议,48表示3.0 即 0x30 = 0011 0000
	NeedReport      byte          `yaml:"need-report"`       // 是否需状态报告
	SmsDisplayNo    string        `yaml:"sms-display-no"`    // 发送号码(后面可拼接子码)
	ServiceId       string        `yaml:"service-id"`        // 运营商分配的服务ID
	DefaultMsgLevel byte          `yaml:"default-msg-level"` // 默认短信优先级 (范围1-9)
	FeeUserType     byte          `yaml:"fee-user-type"`     // 费用相关
	FeeTerminalType byte          `yaml:"fee-terminal-type"` // 费用相关
	FeeTerminalId   string        `yaml:"fee-terminal-id"`   // 费用相关
	FeeType         string        `yaml:"fee-type"`          // 费用相关
	FeeCode         string        `yaml:"fee-code"`          // 费用相关
	FixedFee        string        `yaml:"fixed-fee"`         // 费用相关
	LinkId          string        `yaml:"link-id"`           // 点播业务相关
	MaxConns        int           `yaml:"max-conns"`         // 最大连接数
	MtWindowSize    int           `yaml:"mt-window-size"`    // 接收窗口大小,服务端分配
	MtValidDuration time.Duration `yaml:"mt-valid-duration"` // 短信默认有效期,超过下面配置时长后,如果消息未发送,则不再发送
	Throughput      int           `yaml:"throughput"`        // 系统最大吞吐,单位tps
}

type MongoStore added in v0.5.0

type MongoStore storage

func (*MongoStore) FindByCid added in v0.5.0

func (m *MongoStore) FindByCid(isp string, cid string) (c *Client)

func (*MongoStore) Load added in v0.5.0

func (m *MongoStore) Load()

type Store

type Store interface {
	// Load 从存储加载客户端配置信息
	Load()
	// FindByCid 根据客户端ID获取指定客户端配置信息:
	// isp 运营商,用协议名称表示 CMPP、SGIP、SMGP
	FindByCid(isp string, cid string) *Client
}
var Cache Store

Cache 从存储加载的客户端缓存数据

type YamlStore

type YamlStore storage

func (*YamlStore) FindByCid

func (y *YamlStore) FindByCid(isp string, cid string) *Client

func (*YamlStore) Load

func (y *YamlStore) Load()

Jump to

Keyboard shortcuts

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