part

package
v0.0.35 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: MIT Imports: 67 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// 运行环境,可选项:dev/test/prod
	ENV               EnumEnv = ""
	ENV_LOADED        bool    = false
	USE_PPROF         bool    = false
	APP_NAME          string  = ""
	APP_HOST          string  = "0.0.0.0"
	APP_PORT          int     = 0
	RPCX_SERVICE_PORT int     = 0
	INCLUDE_DEMO      bool    = false
)

Functions

func LoadConfig

func LoadConfig(forceEnv EnumEnv) (err error)

Types

type Cache

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

func NewCacheByConfig

func NewCacheByConfig(config CacheConfig) *Cache

func (*Cache) CreateKey

func (m *Cache) CreateKey(key string) string

func (*Cache) Decr

func (m *Cache) Decr(key string) (result int64, err error)

func (*Cache) Del

func (m *Cache) Del(key string) (result bool, err error)

func (*Cache) Exists

func (m *Cache) Exists(key string) (result bool, err error)

func (*Cache) Get

func (m *Cache) Get(key string) (result string, err error)

func (*Cache) GetBackend

func (m *Cache) GetBackend() (result *redis.Client, err error)

func (*Cache) GetMutex

func (m *Cache) GetMutex(key string, options ...redsync.Option) (result *redsync.Mutex)

func (*Cache) GetMyRank

func (m *Cache) GetMyRank(key string, member string, desc bool) (rank int64, score float64, err error)

func (*Cache) GetRankList

func (m *Cache) GetRankList(key string, start, stop int64, desc bool) (data []redis.Z, allCount int64, err error)

func (*Cache) Incr

func (m *Cache) Incr(key string) (result int64, err error)

func (*Cache) IncrRankScore

func (m *Cache) IncrRankScore(key string, member string, score float64) (err error)

func (*Cache) Md5

func (m *Cache) Md5(str string) string

func (*Cache) Set

func (m *Cache) Set(key string, value string) (result string, err error)

func (*Cache) SetEx

func (m *Cache) SetEx(key string, value string, ttl time.Duration) (result string, err error)

func (*Cache) UpdateRankScore

func (m *Cache) UpdateRankScore(key string, member string, score float64) (err error)

type CacheConfig

type CacheConfig struct {
	AppName  string
	Server   string
	Password string
	DataBase int
	PoolSize int
}

type Captcha

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

func (*Captcha) Draw

func (m *Captcha) Draw(id string) (result *pkg.CaptchaData, err error)

func (*Captcha) New

func (m *Captcha) New() (result *pkg.CaptchaData, err error)

func (*Captcha) Reload

func (m *Captcha) Reload(id string) (result *pkg.CaptchaData, err error)

func (*Captcha) Verify

func (m *Captcha) Verify(id string, digits string) (result bool, err error)

type Channel

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

type Component added in v0.0.23

type Component struct {
	Wechat       *wechat.Wechat
	InnerCache   *cache.Redis
	MiniProgram  IMiniProgram
	OpenPlatform IOpenPlatform
}

func (*Component) GetMiniProgram added in v0.0.23

func (m *Component) GetMiniProgram() (result IMiniProgram)

func (*Component) GetOpenPlatform added in v0.0.23

func (m *Component) GetOpenPlatform() (result IOpenPlatform)

type DataBase

type DataBase struct {
	Enable bool
	// contains filtered or unexported fields
}

func (*DataBase) Commit

func (m *DataBase) Commit(transId string) (err error)

func (*DataBase) GetDB

func (m *DataBase) GetDB() *gorm.DB

func (*DataBase) GetTransaction

func (m *DataBase) GetTransaction(transId string) (result *gorm.DB, err error)

func (*DataBase) Rollback

func (m *DataBase) Rollback(transId string) (err error)

type DataItem added in v0.0.23

type DataItem struct {
	Value interface{} `json:"value"`
	Color string      `json:"color"`
}

DataItem 模版内某个 .DATA 的值

type DataLog

type DataLog struct {
	Id         string    `gorm:"size:20;primaryKey" json:"id"`
	Table      string    `gorm:"size:100" json:"table"`
	Action     string    `gorm:"size:10" json:"action"`
	Executor   string    `gorm:"size:50" json:"executor"`
	Content    string    `gorm:"type:longText" json:"content"`
	CreateTime time.Time `json:"createTime"`
}

func (DataLog) TableName

func (DataLog) TableName() string

type DataLogger

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

func (*DataLogger) WriteAddLog

func (m *DataLogger) WriteAddLog(entity base.IDBModel, ctx context.Context, transId string) (err error)

func (*DataLogger) WriteDelLog

func (m *DataLogger) WriteDelLog(entity base.IDBModel, ctx context.Context, transId string) (err error)

func (*DataLogger) WriteEditLog

func (m *DataLogger) WriteEditLog(oldEntity, newEntity base.IDBModel, ctx context.Context, transId string) (err error)

func (*DataLogger) WriteUpdateLog

func (m *DataLogger) WriteUpdateLog(oldEntity base.IDBModel, newValues map[string]interface{}, ctx context.Context, transId string) (err error)

type DataUpdateLog

type DataUpdateLog struct {
	Op    string      `json:"op"`
	Path  string      `json:"path"`
	Value interface{} `json:"value"`
}

type EnumEnv

type EnumEnv string
const (
	// 开发环境
	ENUM_ENV_DEV EnumEnv = "dev"
	// 测试环境
	ENUM_ENV_TEST EnumEnv = "test"
	// 预发布环境
	ENUM_ENV_PRE EnumEnv = "pre"
	// 生产环境
	ENUM_ENV_PROD EnumEnv = "prod"
)

type GetUserInfoResponse added in v0.0.29

type GetUserInfoResponse struct {
	Success  bool         `json:"success"`
	Message  string       `json:"message"`
	UserInfo QYWXUserInfo `json:"userInfo"`
}

type ICache

type ICache interface {
	GetBackend() (result *redis.Client, err error)
	Get(key string) (result string, err error)
	Set(key string, value string) (result string, err error)
	SetEx(key string, value string, ttl time.Duration) (result string, err error)
	Del(key string) (result bool, err error)
	Exists(key string) (result bool, err error)
	Incr(key string) (result int64, err error)
	Decr(key string) (result int64, err error)
	CreateKey(key string) string
	GetMutex(key string, options ...redsync.Option) (result *redsync.Mutex)
	GetRankList(key string, start, stop int64, desc bool) (data []redis.Z, allCount int64, err error)
	UpdateRankScore(key string, member string, score float64) (err error)
	IncrRankScore(key string, member string, score float64) (err error)
	GetMyRank(key string, member string, desc bool) (rank int64, score float64, err error)
}

func NewCache

func NewCache() ICache

type ICaptcha

type ICaptcha interface {
	New() (result *pkg.CaptchaData, err error)
	Reload(id string) (result *pkg.CaptchaData, err error)
	Draw(id string) (result *pkg.CaptchaData, err error)
	Verify(id string, digits string) (result bool, err error)
}

func NewCaptcha

func NewCaptcha(cache ICache) ICaptcha

type IComponent added in v0.0.23

type IComponent interface {
	GetMiniProgram() (result IMiniProgram)
	GetOpenPlatform() (result IOpenPlatform)
}

func NewComponent added in v0.0.23

func NewComponent() IComponent

type IDataBase

type IDataBase interface {
	GetDB() *gorm.DB
	GetTransaction(transId string) (result *gorm.DB, err error)
	Commit(transId string) (err error)
	Rollback(transId string) (err error)
}

func NewDataBase

func NewDataBase(lruCache ILruCache) IDataBase

type IDataLogger

type IDataLogger interface {
	WriteAddLog(entity base.IDBModel, ctx context.Context, transId string) (err error)
	WriteDelLog(entity base.IDBModel, ctx context.Context, transId string) (err error)
	WriteEditLog(oldEntity, newEntity base.IDBModel, ctx context.Context, transId string) (err error)
	WriteUpdateLog(oldEntity base.IDBModel, newValues map[string]interface{}, ctx context.Context, transId string) (err error)
}

func NewDataLogger

func NewDataLogger(db IDataBase) IDataLogger

type IJobCenter

type IJobCenter interface {
	RegisteJob(job func() *goflow.Job)
	Run()
}

func NewJobCenter

func NewJobCenter() IJobCenter

type IJwtService

type IJwtService interface {
	// CreateToken 生成Token,默认存入Cookie中
	CreateToken(ctx iris.Context, claims interface{}) (token string, err error)
	// GetClaims 验证Token并返回其中包含的Claims对象指针,需要在Middleware处理后才能获得,如需手动验证,请使用VerifyToken方法,强烈建议使用此方法
	GetClaims(ctx iris.Context) (claims interface{}, err error)
	// VerifyToken 从默认渠道(Cookie)中获取Token信息并验证,验证成功后返回VerifiedToken对象,仅用于手动验证,不建议使用
	VerifyToken(ctx iris.Context) (result *jwt.VerifiedToken, err error)
	// RemoveToken 从Cookie中移除Token信息,一般用于"注销"功能
	RemoveToken(ctx iris.Context)
	// GetMiddleware 获取iris路由中间件,用于验证请求合法性
	GetMiddleware() iris.Handler
	// 获取用户JWT对象
	GetExecutorInfo(ctx iris.Context) (result pkg.BaseUserInfo, err error)
	// 获取用户请求Context
	GetExecutorContext(ctx iris.Context) context.Context
	// 获取用户请求Context
	GetExecutorContextWithInfo(ctx iris.Context) (result context.Context, info *pkg.BaseUserInfo)
	// 从cookie中获取Token
	VerifyCookieToken(token string) (result *jwt.VerifiedToken, err error)
}

func NewJWT

func NewJWT() IJwtService

type ILogCenter

type ILogCenter interface {
	Log() *logrus.Logger
}

func NewLogCenter

func NewLogCenter() ILogCenter

type ILruCache

type ILruCache interface {
	Add(key, value interface{}) (success bool)
	AddEx(key, value interface{}, expire time.Duration) (success bool)
	Get(key interface{}) (result interface{}, success bool)
	Contains(key interface{}) (success bool)
	Peek(key interface{}) (result interface{}, success bool)
	ContainsOrAdd(key, value interface{}) (success, evict bool)
	Remove(key interface{})
	RemoveOldest()
	Keys() (result []interface{})
	Len() (result int)
	Purge()
}

func NewLruCache

func NewLruCache() ILruCache

type IMiniProgram added in v0.0.23

type IMiniProgram interface {
	GetOpenId(jsCode string) (result string, err error)
	GetUserInfo(jsCode, encryptedData, iv string) (result *encryptor.PlainData, err error)

	SendSubscribe(msg *Message) (err error)
}

type IMsgCenter

type IMsgCenter interface {
	OpenChannel(channels []string, onReceiveMsg func(*centrifuge.ClientInfo, *pkg.MsgContent)) (err error)
	CloseChannel(channels []string) (err error)
	SendMsg(channel, msgType, msg string) (err error)
	CreateAppChannelId(channel string) (result string, err error)
	GetConnToken(user string, exp int64) string
	GetSubscriptionToken(channel string, user string, exp int64) (channelId string, token string)
}

func NewMsgCenter

func NewMsgCenter(logCenter ILogCenter) IMsgCenter

type INsq

type INsq interface {
	GetProducer() (result *nsq.Producer, err error)
	GetConsumer(topic string, channel string, handler nsq.Handler) (result *nsq.Consumer, err error)
}

func NewNsq

func NewNsq() INsq

type IOpenPlatform added in v0.0.23

type IOpenPlatform interface {
	GetServer(req *http.Request, writer http.ResponseWriter) (result *server.Server)
}

type IQYWXService added in v0.0.29

type IQYWXService interface {
	GetAuthUrl(authTarget, requestId string) (result string)
	GetCacheKey(requestId string, cacheType QywxCacheKeyType) string
	TryAuth(ctx iris.Context, authTarget, authBackUrl string) (result QYWXUserInfo, err error)
	ProcessAuthInfo(ctx iris.Context) (result QYWXUserInfo, err error)
	GetAuthedUserInfo(ctx iris.Context) (result QYWXUserInfo, err error)
}

func NewQYWXService added in v0.0.29

func NewQYWXService(cache ICache, sessionCache ISessionCache, logCenter ILogCenter) IQYWXService

type IRpcxService added in v0.0.12

type IRpcxService interface {
	InitConfig() (err error)
	InitRpcx() (err error)
	RegisterName(serviceName string, rcvr interface{}, metadata string) (err error)
	RegisterFunction(servicePath string, fn interface{}, metadata string) (err error)
	RegisterFunctionName(servicePath string, fnName string, fn interface{}, metadata string) (err error)
	GetClient(serviceName string, callback func(clt client.XClient) error) (err error)
	Serve() (err error)
}

func NewRpcxService added in v0.0.13

func NewRpcxService() (registry IRpcxService)

type ISessionCache

type ISessionCache interface {
	Get(ctx iris.Context, key string) (result string, err error)
	Set(ctx iris.Context, key string, value string, ttl time.Duration) (result string, err error)
	Del(ctx iris.Context, key string) (result bool, err error)
	Exists(ctx iris.Context, key string) (result bool, err error)
	Incr(ctx iris.Context, key string) (result int64, err error)
	GetCacheKey(ctx iris.Context, key string) string
}

func NewSessionCache

func NewSessionCache(cache ICache) ISessionCache

type ISwaggerService

type ISwaggerService interface {
}

func NewSwaggerService

func NewSwaggerService(app *iris.Application, spec *swag.Spec) ISwaggerService

type IUnionJD

type IUnionJD interface {
	BysubunionidPromotion(req common.Request) (result response.PromotionCodeResult, err error)
	OrderRowQuery(req common.Request) (result response.OrderRowQueryResult, err error)
	GetJDDeepLink(platform string, sourceUrl string) (result string, err error)
}

func NewUnionJD

func NewUnionJD() IUnionJD

type IWxAuth

type IWxAuth interface {
	GetCurrentUser(ctx iris.Context) (result *pkg.WxAuthInfo)
	CheckAuth(ctx iris.Context, cak string, customReturnURL string) (result bool)
	ClearAuth(ctx iris.Context) (err error)
	DoAuth(ctx iris.Context, afterAuth func(authInfo *pkg.WxAuthInfo, cak string) (customRedirect bool))
	GetAuthUrl(cak string) (result string)
}

func NewWxAuth

func NewWxAuth(cache ICache, sessionCache ISessionCache, logCenter ILogCenter) IWxAuth

type JWTService

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

func NewCustomJWT

func NewCustomJWT(header string) *JWTService

func (*JWTService) CreateToken

func (m *JWTService) CreateToken(ctx iris.Context, claims interface{}) (token string, err error)

CreateToken 生成Token,默认存入Cookie中

func (*JWTService) FromCookie

func (m *JWTService) FromCookie(ctx iris.Context) string

func (*JWTService) FromHeader

func (m *JWTService) FromHeader(ctx iris.Context) string

func (*JWTService) GetClaims

func (m *JWTService) GetClaims(ctx iris.Context) (claims interface{}, err error)

GetClaims 验证Token并返回其中包含的Claims对象指针,需要在Middleware处理后才能获得,如需手动验证,请使用VerifyToken方法,强烈建议使用此方法

func (*JWTService) GetExecutorContext

func (m *JWTService) GetExecutorContext(ctx iris.Context) context.Context

func (*JWTService) GetExecutorContextWithInfo

func (m *JWTService) GetExecutorContextWithInfo(ctx iris.Context) (result context.Context, info *pkg.BaseUserInfo)

func (*JWTService) GetExecutorInfo

func (m *JWTService) GetExecutorInfo(ctx iris.Context) (result pkg.BaseUserInfo, err error)

func (*JWTService) GetMiddleware

func (m *JWTService) GetMiddleware() iris.Handler

GetMiddleware 获取iris路由中间件,用于验证请求合法性

func (*JWTService) RemoveToken

func (m *JWTService) RemoveToken(ctx iris.Context)

RemoveToken 从Cookie中移除Token信息,一般用于"注销"功能

func (*JWTService) VerifyCookieToken

func (m *JWTService) VerifyCookieToken(token string) (result *jwt.VerifiedToken, err error)

func (*JWTService) VerifyToken

func (m *JWTService) VerifyToken(ctx iris.Context) (result *jwt.VerifiedToken, err error)

VerifyToken 从默认渠道(Cookie)中获取Token信息并验证,验证成功后返回VerifiedToken对象,仅用于手动验证,不建议使用

type JobCenter

type JobCenter struct {
	Enable bool
	// contains filtered or unexported fields
}

func (*JobCenter) RegisteJob

func (m *JobCenter) RegisteJob(job func() *goflow.Job)

func (*JobCenter) Run added in v0.0.17

func (m *JobCenter) Run()

type LogCenter

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

func (*LogCenter) Log

func (m *LogCenter) Log() *logrus.Logger

type LruCache

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

Cache is a thread-safe fixed size LRU cache.

func New

func New(size int) (*LruCache, error)

New creates an LRU of the given size

func NewWithEvict

func NewWithEvict(size int, onEvicted func(key interface{}, value interface{})) (*LruCache, error)

NewWithEvict constructs a fixed size cache with the given eviction callback.

func NewWithExpire

func NewWithExpire(size int, expire time.Duration) (*LruCache, error)

NewWithExpire constructs a fixed size cache with expire feature

func (*LruCache) Add

func (c *LruCache) Add(key, value interface{}) bool

Add adds a value to the cache. Returns true if an eviction occurred.

func (*LruCache) AddEx

func (c *LruCache) AddEx(key, value interface{}, expire time.Duration) bool

AddEx adds a value to the cache. Returns true if an eviction occurred.

func (*LruCache) Contains

func (c *LruCache) Contains(key interface{}) bool

Check if a key is in the cache, without updating the recent-ness or deleting it for being stale.

func (*LruCache) ContainsOrAdd

func (c *LruCache) ContainsOrAdd(key, value interface{}) (ok, evict bool)

ContainsOrAdd checks if a key is in the cache without updating the recent-ness or deleting it for being stale, and if not, adds the value. Returns whether found and whether an eviction occurred.

func (*LruCache) Get

func (c *LruCache) Get(key interface{}) (interface{}, bool)

Get looks up a key's value from the cache.

func (*LruCache) Keys

func (c *LruCache) Keys() []interface{}

Keys returns a slice of the keys in the cache, from oldest to newest.

func (*LruCache) Len

func (c *LruCache) Len() int

Len returns the number of items in the cache.

func (*LruCache) Peek

func (c *LruCache) Peek(key interface{}) (interface{}, bool)

Returns the key value (or undefined if not found) without updating the "recently used"-ness of the key.

func (*LruCache) Purge

func (c *LruCache) Purge()

Purge is used to completely clear the cache

func (*LruCache) Remove

func (c *LruCache) Remove(key interface{})

Remove removes the provided key from the cache.

func (*LruCache) RemoveOldest

func (c *LruCache) RemoveOldest()

RemoveOldest removes the oldest item from the cache.

type Message added in v0.0.23

type Message struct {
	ToUser           string               `json:"touser"`            // 必选,接收者(用户)的 openid
	TemplateID       string               `json:"template_id"`       // 必选,所需下发的订阅模板id
	Page             string               `json:"page"`              // 可选,点击模板卡片后的跳转页面,仅限本小程序内的页面。支持带参数,(示例index?foo=bar)。该字段不填则模板无跳转。
	Data             map[string]*DataItem `json:"data"`              // 必选, 模板内容
	MiniprogramState string               `json:"miniprogram_state"` // 可选,跳转小程序类型:developer为开发版;trial为体验版;formal为正式版;默认为正式版
	Lang             string               `json:"lang"`              // 入小程序查看”的语言类型,支持zh_CN(简体中文)、en_US(英文)、zh_HK(繁体中文)、zh_TW(繁体中文),默认为zh_CN
}

Message 订阅消息请求参数

type MiniProgram added in v0.0.23

type MiniProgram struct {
	Program *miniprogram.MiniProgram
	// contains filtered or unexported fields
}

func NewMiniProgram added in v0.0.23

func NewMiniProgram(context *Component) *MiniProgram

func (*MiniProgram) GetOpenId added in v0.0.23

func (m *MiniProgram) GetOpenId(jsCode string) (result string, err error)

func (*MiniProgram) GetUserInfo added in v0.0.23

func (m *MiniProgram) GetUserInfo(jsCode, encryptedData, iv string) (result *encryptor.PlainData, err error)

func (*MiniProgram) SendSubscribe added in v0.0.23

func (m *MiniProgram) SendSubscribe(msg *Message) (err error)

Send 发送订阅消息

type MsgCenter

type MsgCenter struct {
	Enable bool
	// contains filtered or unexported fields
}

func (*MsgCenter) CloseChannel

func (m *MsgCenter) CloseChannel(channels []string) (err error)

func (*MsgCenter) CreateAppChannelId

func (m *MsgCenter) CreateAppChannelId(channel string) (result string, err error)

func (*MsgCenter) GetConnToken

func (m *MsgCenter) GetConnToken(user string, exp int64) string

func (*MsgCenter) GetSubscriptionToken

func (m *MsgCenter) GetSubscriptionToken(channel string, user string, exp int64) (channelId string, token string)

func (*MsgCenter) OpenChannel

func (m *MsgCenter) OpenChannel(channels []string, onReceiveMsg func(*centrifuge.ClientInfo, *pkg.MsgContent)) (err error)

func (*MsgCenter) SendMsg

func (m *MsgCenter) SendMsg(channel, msgType, msg string) (err error)

type Nsq

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

func (*Nsq) GetConsumer

func (m *Nsq) GetConsumer(topic string, channel string, handler nsq.Handler) (result *nsq.Consumer, err error)

func (*Nsq) GetProducer

func (m *Nsq) GetProducer() (result *nsq.Producer, err error)

type OpenPlatform added in v0.0.23

type OpenPlatform struct {
	Platform *openplatform.OpenPlatform
	// contains filtered or unexported fields
}

func NewOpenPlatform added in v0.0.23

func NewOpenPlatform(context *Component) *OpenPlatform

func (*OpenPlatform) GetServer added in v0.0.23

func (m *OpenPlatform) GetServer(req *http.Request, writer http.ResponseWriter) (result *server.Server)

type QYWXService added in v0.0.29

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

func (*QYWXService) GetAuthUrl added in v0.0.29

func (m *QYWXService) GetAuthUrl(authTarget, requestId string) (result string)

func (*QYWXService) GetAuthedUserInfo added in v0.0.29

func (m *QYWXService) GetAuthedUserInfo(ctx iris.Context) (result QYWXUserInfo, err error)

func (*QYWXService) GetCacheKey added in v0.0.29

func (m *QYWXService) GetCacheKey(requestId string, cacheType QywxCacheKeyType) string

func (*QYWXService) ProcessAuthInfo added in v0.0.29

func (m *QYWXService) ProcessAuthInfo(ctx iris.Context) (result QYWXUserInfo, err error)

第二步:处理授权信息,如果有返回链接,则跳转

func (*QYWXService) SendMessage added in v0.0.29

func (m *QYWXService) SendMessage(touser string, content string) (err error)

func (*QYWXService) TryAuth added in v0.0.29

func (m *QYWXService) TryAuth(ctx iris.Context, authTarget, authBackUrl string) (result QYWXUserInfo, err error)

第一步:尝试登录,如果已经登录,直接返回

type QYWXUserInfo added in v0.0.29

type QYWXUserInfo struct {
	UserId   string `json:"userid"`
	UserName string `json:"name"`
	Alias    string `json:"alias"`
	Status   int    `json:"status"`
}

type QywxCacheKeyType added in v0.0.29

type QywxCacheKeyType int
const (
	QywxSessionCacheKey QywxCacheKeyType = iota
	QywxExtDataCacheKey
)

type RedisStore

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

func NewRedisStore

func NewRedisStore(cache ICache) *RedisStore

func (*RedisStore) Get

func (m *RedisStore) Get(id string, clear bool) string

func (*RedisStore) Set

func (m *RedisStore) Set(id string, value string) error

func (*RedisStore) Verify

func (m *RedisStore) Verify(id, answer string, clear bool) bool

type RpcxService added in v0.0.12

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

func (*RpcxService) GetClient added in v0.0.12

func (m *RpcxService) GetClient(serviceName string, callback func(clt client.XClient) error) (err error)

func (*RpcxService) InitConfig added in v0.0.12

func (m *RpcxService) InitConfig() (err error)

func (*RpcxService) InitRpcx added in v0.0.12

func (m *RpcxService) InitRpcx() (err error)

func (*RpcxService) RegisterFunction added in v0.0.12

func (m *RpcxService) RegisterFunction(servicePath string, fn interface{}, metadata string) (err error)

func (*RpcxService) RegisterFunctionName added in v0.0.12

func (m *RpcxService) RegisterFunctionName(servicePath string, fnName string, fn interface{}, metadata string) (err error)

func (*RpcxService) RegisterName added in v0.0.12

func (m *RpcxService) RegisterName(serviceName string, rcvr interface{}, metadata string) (err error)

func (*RpcxService) Serve added in v0.0.12

func (m *RpcxService) Serve() (err error)

type SessionCache

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

func (*SessionCache) Del

func (m *SessionCache) Del(ctx iris.Context, key string) (result bool, err error)

func (*SessionCache) Exists

func (m *SessionCache) Exists(ctx iris.Context, key string) (result bool, err error)

func (*SessionCache) Get

func (m *SessionCache) Get(ctx iris.Context, key string) (result string, err error)

func (*SessionCache) GetCacheKey

func (m *SessionCache) GetCacheKey(ctx iris.Context, key string) string

func (*SessionCache) Incr

func (m *SessionCache) Incr(ctx iris.Context, key string) (result int64, err error)

func (*SessionCache) Set

func (m *SessionCache) Set(ctx iris.Context, key string, value string, ttl time.Duration) (result string, err error)

type SwaggerService

type SwaggerService struct {
}

type UnionJD

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

func (*UnionJD) BysubunionidPromotion

func (m *UnionJD) BysubunionidPromotion(req common.Request) (result response.PromotionCodeResult, err error)

社交媒体获取推广链接接口

func (m *UnionJD) GetJDDeepLink(platform string, sourceUrl string) (result string, err error)

生成京东Deeplink

func (*UnionJD) OrderRowQuery

func (m *UnionJD) OrderRowQuery(req common.Request) (result response.OrderRowQueryResult, err error)

查询推广订单及佣金信息

type WxAuth

type WxAuth struct {
	Enable bool
	// contains filtered or unexported fields
}

func (*WxAuth) CheckAuth

func (m *WxAuth) CheckAuth(ctx iris.Context, cak string, customReturnURL string) (result bool)

func (*WxAuth) ClearAuth

func (m *WxAuth) ClearAuth(ctx iris.Context) (err error)

func (*WxAuth) DoAuth

func (m *WxAuth) DoAuth(ctx iris.Context, afterAuth func(authInfo *pkg.WxAuthInfo, cak string) (customRedirect bool))

func (*WxAuth) GetAuthUrl

func (m *WxAuth) GetAuthUrl(cak string) (result string)

func (*WxAuth) GetCurrentUser

func (m *WxAuth) GetCurrentUser(ctx iris.Context) (result *pkg.WxAuthInfo)

Jump to

Keyboard shortcuts

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