sessionid

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyUserdata = `userdata`
	KeyModtime  = `modtime`
)

Variables

This section is empty.

Functions

func Init

func Init(cnf *configure.Session)

func IsErrExpired

func IsErrExpired(e error) bool

func Platforms

func Platforms() []string

Types

type Coder

type Coder struct {
}

func (Coder) Marshal

func (Coder) Marshal(session interface{}) (b []byte, e error)

func (Coder) Unmarshal

func (Coder) Unmarshal(b []byte) (session interface{}, e error)

type Manager

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

func DefaultManager

func DefaultManager() *Manager

func (*Manager) Delete

func (m *Manager) Delete(ctx context.Context, access string) (e error)

func (*Manager) DeleteID

func (m *Manager) DeleteID(ctx context.Context, id int64) (e error)

func (*Manager) Get

func (m *Manager) Get(ctx context.Context, access string) (session *Session, e error)

func (*Manager) Put

func (m *Manager) Put(ctx context.Context, id int64, platform string, session *Session) (token *sessionstore.Token, e error)

func (*Manager) Refresh

func (m *Manager) Refresh(ctx context.Context, access, refresh string) (token *sessionstore.Token, e error)

func (*Manager) Sin

func (m *Manager) Sin(playdata string) (string, error)

func (*Manager) Verify

func (m *Manager) Verify(token string) (string, error)

type Session

type Session struct {
	ID            int64
	Name          string
	Nickname      string
	Authorization []int32
	Parent        int64

	Token *sessionstore.Token
}

func (*Session) AuthAny

func (d *Session) AuthAny(vals ...int32) bool

AuthAny if has any authorization return true

func (*Session) AuthNone

func (d *Session) AuthNone(vals ...int32) bool

AuthNone if not has any authorization return true

func (*Session) AuthTest

func (d *Session) AuthTest(vals ...int32) bool

Test if has all authorization return true

func (*Session) Marshal

func (d *Session) Marshal() (b []byte, e error)

func (*Session) Unmarshal

func (d *Session) Unmarshal(b []byte) (e error)

func (*Session) Who

func (d *Session) Who() string

Jump to

Keyboard shortcuts

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