session

package
v0.0.0-...-1fd1f4e Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_EXPIRATION = "604800" // 7*24*60*60s
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

type Session struct {
	SessionId  string   `json:"sessionId"`
	UserId     string   `json:"userId"`
	UserName   string   `json:"userName"`
	OrgId      string   `json:"orgId"`
	DcList     []string `json:"dcList"`
	CreatedAt  string   `json:"CreatedAt"`
	Expiration string   `json:"Expiration"` // expiration in seconds
}

func NewSession

func NewSession(userId, userName, orgId string) *Session

func (*Session) DecodeJson

func (s *Session) DecodeJson(data string) error

func (*Session) EncodeJson

func (s *Session) EncodeJson() (string, error)

type SessionStore

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

func NewSessionStore

func NewSessionStore() *SessionStore

func SessionStoreInstance

func SessionStoreInstance() *SessionStore

func (*SessionStore) Delete

func (ss *SessionStore) Delete(sessionId string) error

func (*SessionStore) Exist

func (ss *SessionStore) Exist(sessionId string) (bool, error)

func (*SessionStore) Get

func (ss *SessionStore) Get(sessionId string) (*Session, error)

func (*SessionStore) Set

func (ss *SessionStore) Set(session *Session) error

func (*SessionStore) ValidateOrgId

func (ss *SessionStore) ValidateOrgId(sessionIdClient string, OrgIdClient string) (bool, error)

func (*SessionStore) ValidateUserId

func (ss *SessionStore) ValidateUserId(sessionIdClient string, UserIdClient string) (bool, error)

Jump to

Keyboard shortcuts

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