ises

package module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2020 License: MIT Imports: 3 Imported by: 0

README

ises

session interface

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorNeedClose = errors.New("error need close")
)

Functions

This section is empty.

Types

type Account

type Account struct {
	Auth AuthLevel

	Uid   int64
	Realm string
	Os    int32
}

type AuthLevel

type AuthLevel int
const (
	ALNone        AuthLevel = 0x0
	ALLoginBasic  AuthLevel = 0x11
	ALLoginNormal AuthLevel = 0x14
	ALLoginHigh   AuthLevel = 0x18
)

type Cache

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

func NewCache

func NewCache() *Cache

func (*Cache) GetCache

func (c *Cache) GetCache(k interface{}) *CacheValue

func (*Cache) GetCacheTimeout

func (c *Cache) GetCacheTimeout(k interface{}, t time.Time) *CacheValue

func (*Cache) ReloadCache

func (c *Cache) ReloadCache(k interface{}, l CacheReLoader) (*CacheValue, error)

func (*Cache) ReloadCacheTimeout

func (c *Cache) ReloadCacheTimeout(k interface{}, l CacheReLoader, t time.Time) (*CacheValue, error)

func (*Cache) SetCache

func (c *Cache) SetCache(k interface{}, v CacheValue)

type CacheKeyInt64

type CacheKeyInt64 int64

func (CacheKeyInt64) CacheKey

func (k CacheKeyInt64) CacheKey() interface{}

type CacheReLoader

type CacheReLoader func() (*CacheValue, error)

type CacheValue

type CacheValue struct {
	Time time.Time
	Val  interface{}
}

type Connection

type Connection struct {
	ConnType ConnectionTypes
}

type ConnectionTypes

type ConnectionTypes int
const (
	STNone ConnectionTypes = iota
	STTcp
	STTls
	STUdp
	STHttp
	STWebsocket
)

type Handler added in v0.0.5

type Handler interface {
	ServeISes(req Request) error
}

type HandlerFunc added in v0.0.5

type HandlerFunc func(Request) error

func (HandlerFunc) ServeISes added in v0.0.5

func (h HandlerFunc) ServeISes(req Request) error

type ICacheKey

type ICacheKey interface {
	CacheKey() interface{}
}

type Request

type Request interface {
	Session
	Response
	Request(proto.Message) error
	GetSession() Session
}

type Response

type Response interface {
	ResponseOK(proto.Message, ...int32) error
	ResponseError(code int32, msg string) error
}

type Session

type Session interface {
	GetConnection() *Connection
	GetAccount() *Account
	GetCache() *Cache
}

Jump to

Keyboard shortcuts

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