models

package
v0.0.0-...-0a4ec91 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllModels = []interface{}{
	new(User),
	new(Node),
	new(Key),
	new(Grant),
	new(Session),
	new(Token),
	new(MasterKey),
}

Functions

This section is empty.

Types

type Grant

type Grant struct {
	Id              string `storm:"id"`
	Account         string `storm:"index"`
	HostnamePattern string
	User            string
	ExpiredAt       int64
	CreatedAt       int64
}

func (Grant) BuildId

func (n Grant) BuildId() string

func (Grant) ToGRPCGrant

func (n Grant) ToGRPCGrant() *types.Grant

type Key

type Key struct {
	Fingerprint string `storm:"id"`
	Account     string `storm:"index"`
	Source      string `storm:"index"`
	Name        string
	CreatedAt   int64
	ViewedAt    int64
}

func (Key) ToGRPCKey

func (k Key) ToGRPCKey() *types.Key

type MasterKey

type MasterKey struct {
	Fingerprint string `storm:"id"`
	PublicKey   string
}

func (MasterKey) ToGRPCModel

func (m MasterKey) ToGRPCModel() *types.MasterKey

type Node

type Node struct {
	Hostname     string `storm:"id"`
	User         string
	Address      string
	Source       string `storm:"index"`
	CreatedAt    int64
	IsKeyManaged bool
	ViewedAt     int64
}

Node server model

func (Node) ToGRPCNode

func (n Node) ToGRPCNode() *types.Node

type Session

type Session struct {
	Id         int64  `storm:"id,increment"`
	Account    string `storm:"index"`
	Command    string
	CreatedAt  int64
	FinishedAt int64
	IsRecorded bool
}

func (Session) ToGRPCSession

func (s Session) ToGRPCSession() *types.Session

type Token

type Token struct {
	Id          int64  `storm:"id,increment"`
	Token       string `storm:"unique"`
	Account     string `storm:"index"`
	Description string
	CreatedAt   int64
	ViewedAt    int64
}

func (Token) ToGRPCToken

func (n Token) ToGRPCToken() *types.Token

func (Token) ToGRPCTokenSecure

func (n Token) ToGRPCTokenSecure() *types.Token

type User

type User struct {
	Account        string `storm:"id"` // primary key
	Nickname       string
	PasswordDigest string
	PasswordFailed int64
	IsAdmin        bool
	IsBlocked      bool
	CreatedAt      int64
	UpdatedAt      int64
	ViewedAt       int64
}

User user model in boltdb, mirror of types.User

func (User) ToGRPCUser

func (u User) ToGRPCUser() *types.User

Jump to

Keyboard shortcuts

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