core

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotDelete = 0
	Deleted   = 1
)
View Source
const AuthorizationHeader = "Authorization"
View Source
const BuildVersion = "1.11.0"
View Source
const EmptyString = ""

Variables

View Source
var CurrentCommit string

Functions

func IsValid added in v1.11.0

func IsValid(perm Permission) bool

func WithPerm

func WithPerm(ctx context.Context, perm Permission) context.Context

Types

type DBPrefix

type DBPrefix = []byte

type LogField

type LogField = string
const (
	FieldName    LogField = "name"
	FieldIP      LogField = "ip"
	FieldLevel   LogField = "level"
	FieldSvcName LogField = "svcName"
	FieldSpanId  LogField = "spanId"
	FieldPreHost LogField = "preHost"
	FieldElapsed LogField = "elapsed"
	FieldToken   LogField = "token"
)

type Measurement

type Measurement = string
const (
	MTMethod Measurement = "method"
)

type Page added in v1.2.0

type Page struct {
	Skip  int64 `form:"skip" json:"skip"`
	Limit int64 `form:"limit" json:"limit"`
}

func (*Page) GetLimit added in v1.2.0

func (o *Page) GetLimit() int64

func (*Page) GetSkip added in v1.2.0

func (o *Page) GetSkip() int64

type PermKey

type PermKey int
var PermCtxKey PermKey

type Permission

type Permission = string
const (
	// When changing these, update docs/API.md too
	PermRead  Permission = "read" // default
	PermWrite Permission = "write"
	PermSign  Permission = "sign"  // Use wallet keys for signing
	PermAdmin Permission = "admin" // Manage permissions
)

func AdaptOldStrategy

func AdaptOldStrategy(perm Permission) []Permission

type UserState added in v1.4.0

type UserState int
const (
	UserStateUndefined UserState = iota
	UserStateEnabled
	UserStateDisabled
)

For compatibility with older versions of the API

func (UserState) String added in v1.4.0

func (us UserState) String() string

Jump to

Keyboard shortcuts

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