user

package
v0.0.0-...-cb7f019 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SuperUser

type SuperUser struct {
	Username string `env:"ADMIN_USERNAME"`
	Password string `env:"ADMIN_PASSWORD"`
}

func NewSuperUserEnvConfig

func NewSuperUserEnvConfig() *SuperUser

type User

type User struct {
	ID              string
	Token           string
	BareToken       string
	IsPublic        bool
	IsAuthenticated bool
	UserAttributes  *UserAttributes
	AccessToken     string
	// contains filtered or unexported fields
}

func FromContext

func FromContext(ctx context.Context) *User

func Setup

func Setup(get func(key string) string) (*User, error)

func (*User) IncrementAccountBalance

func (u *User) IncrementAccountBalance(amount int) error

func (*User) WithContext

func (u *User) WithContext(ctx context.Context) context.Context

type UserAttributes

type UserAttributes struct {
	Currency       string  `json:"custom:currency"`
	Country        string  `json:"custom:country"`
	StoreName      string  `json:"custom:store_name"`
	Website        string  `json:"website"`
	CoverImage     string  `json:"custom:cover_image"`
	ShippingModule int8    `json:"custom:shipping_module,string"`
	FeeMultiplier  float64 `json:"custom:fee_multiplier,string"`
	AccountBalance int     `json:"custom:account_balance,string"`
	CustomCSS      string  `json:"custom:custom_css"`
}

Jump to

Keyboard shortcuts

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