Documentation ¶
Index ¶
- Constants
- func EncryptEndpoint(endpoint *Endpoint) (string, error)
- type BaseClient
- func (s *BaseClient) AttachAuthorization(authorization string)
- func (s *BaseClient) AttachContext(ctx Context)
- func (s *BaseClient) BindEndpoint(endpoint, authToken string)
- func (s *BaseClient) BindToken(sessionToken Token)
- func (s *BaseClient) DetachAuthorization()
- func (s *BaseClient) DetachContext()
- func (s *BaseClient) GetContextValues() url.Values
- func (s *BaseClient) GetHTTPClient() *http.Client
- func (s *BaseClient) GetServerURL() string
- func (s *BaseClient) Release()
- func (s *BaseClient) UnBindEndpoint()
- func (s *BaseClient) UnBindToken()
- type Client
- type Context
- type Endpoint
- type Observer
- type Registry
- type Session
- type Status
- type Token
Constants ¶
View Source
const ( Credential = "Credential" Signature = "Signature" )
View Source
const ( StatusUpdate = iota StatusTerminate )
View Source
const ( // Authorization info, from request header Authorization = "Authorization" // RemoteAddress 远端地址 RemoteAddress = "$$sessionRemoteAddress" )
View Source
const (
DefaultSessionTimeOutValue = 10 * time.Minute // 10 minute
)
Variables ¶
This section is empty.
Functions ¶
func EncryptEndpoint ¶
Types ¶
type BaseClient ¶
type BaseClient struct {
// contains filtered or unexported fields
}
func NewBaseClient ¶
func NewBaseClient(serverUrl string) BaseClient
func (*BaseClient) AttachAuthorization ¶
func (s *BaseClient) AttachAuthorization(authorization string)
func (*BaseClient) AttachContext ¶
func (s *BaseClient) AttachContext(ctx Context)
func (*BaseClient) BindEndpoint ¶
func (s *BaseClient) BindEndpoint(endpoint, authToken string)
func (*BaseClient) BindToken ¶
func (s *BaseClient) BindToken(sessionToken Token)
func (*BaseClient) DetachAuthorization ¶
func (s *BaseClient) DetachAuthorization()
func (*BaseClient) DetachContext ¶
func (s *BaseClient) DetachContext()
func (*BaseClient) GetContextValues ¶
func (s *BaseClient) GetContextValues() url.Values
func (*BaseClient) GetHTTPClient ¶
func (s *BaseClient) GetHTTPClient() *http.Client
func (*BaseClient) GetServerURL ¶
func (s *BaseClient) GetServerURL() string
func (*BaseClient) Release ¶
func (s *BaseClient) Release()
func (*BaseClient) UnBindEndpoint ¶
func (s *BaseClient) UnBindEndpoint()
func (*BaseClient) UnBindToken ¶
func (s *BaseClient) UnBindToken()
type Registry ¶
type Registry interface { GetSession(res http.ResponseWriter, req *http.Request) Session CountSession(filter util.Filter) int }
Registry 会话仓库
type Session ¶
type Session interface { ID() string Signature() (Token, error) Reset() BindObserver(observer Observer) UnbindObserver(observer Observer) GetString(key string) (string, bool) GetInt(key string) (int64, bool) GetUint(key string) (uint64, bool) GetFloat(key string) (float64, bool) GetBool(key string) (bool, bool) GetOption(key string) (interface{}, bool) SetOption(key string, value interface{}) RemoveOption(key string) }
Session 会话
Click to show internal directories.
Click to hide internal directories.