apikeymodel

package
Version: v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {
	Keyid    string `model:"keyid,VARCHAR(63) PRIMARY KEY" query:"keyid,getoneeq,keyid;updeq,keyid;deleq,keyid"`
	Userid   string `model:"userid,VARCHAR(31) NOT NULL;index" query:"userid,deleq,userid"`
	AuthTags rank.Rank

	KeyHash string `model:"keyhash,VARCHAR(127) NOT NULL" query:"keyhash"`
	Name    string `model:"name,VARCHAR(255)" query:"name"`
	Desc    string `model:"description,VARCHAR(255)" query:"description"`
	Time    int64  `model:"time,BIGINT NOT NULL" query:"time,getgroupeq,userid"`
	// contains filtered or unexported fields
}

type Repo

type Repo interface {
	New(userid string, authtags rank.Rank, name, desc string) (*Model, string, error)
	ValidateKey(key string, m *Model) (bool, error)
	RehashKey(m *Model) (string, error)
	GetByID(keyid string) (*Model, error)
	GetUserKeys(userid string, limit, offset int) ([]Model, error)
	GetUserKeyIDs(userid string, limit, offset int) ([]string, error)
	Insert(m *Model) error
	Update(m *Model) error
	Delete(m *Model) error
	DeleteUserKeys(userid string) error
	Setup() error
}

func New

func New(database db.Database) Repo

Jump to

Keyboard shortcuts

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