types

package
v0.0.0-...-a5319db Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSessionTokenExpired = errors.New("Token is expired")
	ErrSessionTokenInvalid = errors.New("Token is invalid")
)

Functions

func IsNil

func IsNil(i interface{}) bool

Types

type BigNumber

type BigNumber struct {
	*big.Int
}

func NewBigNumber

func NewBigNumber[T Number](value T) *BigNumber

func (*BigNumber) Copy

func (bigNumber *BigNumber) Copy() BigNumber

func (*BigNumber) IsNil

func (bigNumber *BigNumber) IsNil() bool

func (*BigNumber) MarshalBinary

func (bigNumber *BigNumber) MarshalBinary() ([]byte, error)

func (*BigNumber) MarshalJSON

func (bigNumber *BigNumber) MarshalJSON() ([]byte, error)

func (*BigNumber) MarshalText

func (bigNumber *BigNumber) MarshalText() ([]byte, error)

func (*BigNumber) Scan

func (bigNumber *BigNumber) Scan(value interface{}) error

func (*BigNumber) UnmarshalBinary

func (bigNumber *BigNumber) UnmarshalBinary(text []byte) error

func (*BigNumber) UnmarshalJSON

func (bigNumber *BigNumber) UnmarshalJSON(value []byte) error

func (*BigNumber) UnmarshalText

func (bigNumber *BigNumber) UnmarshalText(text []byte) error

func (*BigNumber) Value

func (bigNumber *BigNumber) Value() (driver.Value, error)

type Number

type Number interface {
	int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 | *big.Int
}

type SessionToken

type SessionToken struct {
	UserId    string            `json:"uid,omitempty"`
	Username  string            `json:"usn,omitempty"`
	Vars      map[string]string `json:"vrs,omitempty"`
	ExpiresAt int64             `json:"exp,omitempty"`
}

func ParseSessionToken

func ParseSessionToken(hmacSecretByte []byte, tokenString string) (*SessionToken, error)

func (*SessionToken) Valid

func (stc *SessionToken) Valid() error

type Status

type Status int16

func (Status) Int

func (j Status) Int() int

func (*Status) Scan

func (j *Status) Scan(value interface{}) error

func (Status) Value

func (j Status) Value() (driver.Value, error)

type String

type String string

func (*String) MarshalBinary

func (s *String) MarshalBinary() ([]byte, error)

func (*String) MarshalJSON

func (s *String) MarshalJSON() ([]byte, error)

func (*String) MarshalText

func (s *String) MarshalText() ([]byte, error)

func (*String) Scan

func (j *String) Scan(value interface{}) error

func (*String) UnmarshalBinary

func (s *String) UnmarshalBinary(text []byte) error

func (*String) UnmarshalJSON

func (s *String) UnmarshalJSON(value []byte) error

func (*String) UnmarshalText

func (s *String) UnmarshalText(text []byte) error

func (String) Value

func (j String) Value() (driver.Value, error)

type Tags

type Tags []string

func (*Tags) Interface

func (j *Tags) Interface() []interface{}

func (*Tags) Scan

func (j *Tags) Scan(value interface{}) error

func (*Tags) ToMap

func (j *Tags) ToMap() map[string]bool

func (Tags) Value

func (j Tags) Value() (driver.Value, error)

type TagsInt

type TagsInt []int

func (*TagsInt) Interface

func (j *TagsInt) Interface() []interface{}

func (*TagsInt) Scan

func (j *TagsInt) Scan(value interface{}) error

func (*TagsInt) ToMap

func (j *TagsInt) ToMap() map[int]bool

func (TagsInt) Value

func (j TagsInt) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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