database

package
v0.0.0-...-20359fc Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CFImager

type CFImager interface {
	RetrieveAuthToken(token []byte) error
	RegisterAuthToken(owner uint64, token []byte) (err error)
	RevokeUsersTokens(userId uint64) (err error)
	AddTempUser(email string, hash, salt []byte) (id uint64, err error)
	ValidateUser(id uint64) (err error)
	GetTempUserId(email string) (id uint64, err error)
	SetSource(ownerId, funcId uint64, source string) (err error)
	SetCompiledAndError(ownerId, funcId uint64, wasm, js, wjs []byte, errStr string) (err error)
	GetWasm(ownerId, funcId uint64) (data []byte, err error)
	GetJS(ownerId, funcId uint64) (data []byte, err error)
	GetWJS(ownerId, funcId uint64) (data []byte, err error)
	GetSourceAndError(ownerId, funcId uint64) (source, errStr string, err error)
	SetName(ownerId, funcId uint64, name string) (err error)
	SetSourceAndName(ownerId, funcId uint64, source, name string) (err error)
	NewFunction(ownerId uint64, name string) (id uint64, err error)
	CreateUser(email string, hash, salt []byte) (err error)
	GetUserAuthData(email string, hash, salt *[]byte) (id uint64, err error)
	GetSource(ownerId, funcId uint64) (source string, err error)
	ListFunctions(ownerId uint64) (funcs Functions, err error)
	DeleteFunction(ownerId, funcId uint64) (err error)
	GetUsedAndCapacity(userId uint64) (used, capacity uint64, err error)
	ChangePassword(userId uint64, hash, salt []byte) (err error)
	GetId(email string) (id uint64, err error)
	DeleteAuthToken(token []byte) (err error)
}

func NewCFImager

func NewCFImager(url string, refreshTokenExpire time.Duration) (CFImager, error)

type Function

type Function struct {
	Id   uint64
	Name string
	Size uint64
}

type Functions

type Functions struct {
	Functions []Function
	Total     uint64
	Capacity  uint64
	Low, High uint64
}

type Queries

type Queries struct {
	AuthTokens      QueriesAuthTokens
	EmailValidation QueriesEmailValidations
	Functions       QueriesFunctions
	Users           QueriesUsers
}

type QueriesAuthTokens

type QueriesAuthTokens struct {
	GetToken      *sql.Stmt
	CreateToken   *sql.Stmt
	DeleteExpired *sql.Stmt
	RevokeForUser *sql.Stmt
	DeleteToken   *sql.Stmt
}

type QueriesEmailValidations

type QueriesEmailValidations struct {
	GetId *sql.Stmt
}

type QueriesFunctions

type QueriesFunctions struct {
	SetSource           *sql.Stmt
	GetSource           *sql.Stmt
	SetCompiledAndError *sql.Stmt
	GetWasm             *sql.Stmt
	GetJs               *sql.Stmt
	GetWJS              *sql.Stmt
	GetSourceAndError   *sql.Stmt
	SetName             *sql.Stmt
	SetNameAndSource    *sql.Stmt
}

type QueriesUsers

type QueriesUsers struct {
	Create          *sql.Stmt
	Get             *sql.Stmt
	GetUsedCapacity *sql.Stmt
	ChangePassword  *sql.Stmt
	GetUserId       *sql.Stmt
}

Jump to

Keyboard shortcuts

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