models

package
v0.0.0-...-04ebf03 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const (
	NamespaceKey          = "namespace"
	DefaultNamespaceValue = "global" // TODO: using 'public'
	GlobalNamespaceValue  = "global"
)
View Source
const (
	PageKey     = "page"
	PageSizeKey = "pageSize"
)

Variables

View Source
var (
	ErrNotFound    = errors.New("no record")
	ErrNameTooLong = errors.New("name too long")
	ErrIsExist     = errors.New("record existed")
	ErrNotEmpty    = errors.New("group not empty")
	ErrNoGroup     = errors.New("not group")
	ErrIsGroup     = errors.New("this object is a group")
	ErrNoAccess    = errors.New("no access")
	ErrNoPerm      = errors.New("no permission")
	ErrConflict    = errors.New("operation conflict")
	ErrUnsupported = errors.New("unsupported operation")
	ErrNotEnable   = errors.New("not enable")
)

Functions

func WithNamespace

func WithNamespace(ctx context.Context, ns *Namespace) context.Context

func WithPagination

func WithPagination(ctx context.Context, page *Pagination) context.Context

Types

type Namespace

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

func GetNamespace

func GetNamespace(ctx context.Context) (ns *Namespace)

func NewNamespace

func NewNamespace(name string) *Namespace

func (*Namespace) String

func (n *Namespace) String() string

type Pagination

type Pagination struct {
	Page     int64
	PageSize int64
}

func GetPagination

func GetPagination(ctx context.Context) *Pagination

func NewPagination

func NewPagination(page, pageSize int64) *Pagination

func (*Pagination) Limit

func (p *Pagination) Limit() int

func (*Pagination) Offset

func (p *Pagination) Offset() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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