models

package
v0.0.0-...-7cc416c Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckNode

func CheckNode(name string) (error, bool)

func CheckToken

func CheckToken(name string) (err error, ok bool)

func CloseDB

func CloseDB(db *gorm.DB)

func CreateLabelWithNode

func CreateLabelWithNode(name string, node string) error

func CreateNode

func CreateNode(name string, role string, kv string, os string, dv string) error

func CreateToken

func CreateToken(name string, token string) error

func GetLabelNodes

func GetLabelNodes(name string) (nodes []string, err error)

func Setup

func Setup()

func UpdateNode

func UpdateNode(name string, role string, kv string, os string, dv string) error

func UpdateToken

func UpdateToken(name string, token string) error

Types

type Action

type Action struct {
	Time    time.Time
	Context string
}

type Label

type Label struct {
	gorm.Model
	Name string
	Node string
}

func ListAllLabels

func ListAllLabels() ([]*Label, error)

func OnlyListLabels

func OnlyListLabels() ([]*Label, error)

type Log

type Log struct {
	Types   string
	Time    time.Time
	Context string
	Node    string
}

type Model

type Model struct {
	ID         int `gorm:"primary_key" json:"id"`
	CreatedOn  int `json:"created_on"`
	ModifiedOn int `json:"modified_on"`
	DeletedOn  int `json:"deleted_on"`
}

type Node

type Node struct {
	Name            string `gorm:"PRIMARY_KEY;unique;not null"`
	Role            string `gorm:"size:255"`
	KernelVersion   string
	OperatingSystem string
	DockerVersion   string
	JoinTime        time.Time
	UpdateTime      time.Time
}

func GetNode

func GetNode(name string) (err error, node Node)

func ListNodes

func ListNodes() ([]*Node, error)

type Token

type Token struct {
	Name         string `gorm:"PRIMARY_KEY;unique;not null"`
	Token        string
	GenerateTime time.Time
	UpdateTime   time.Time
}

func GetToken

func GetToken(name string) (*Token, error)

func ListToken

func ListToken() ([]*Token, error)

Jump to

Keyboard shortcuts

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