models

package
v0.0.0-...-8232506 Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BootupStatePending is the 0 state for bootup process
	BootupStatePending = iota
	// BootupStateCompleted is the 2 state for bootup process
	BootupStateCompleted
)
View Source
const (
	// RoleAdmin is the admin role for a user
	RoleAdmin = iota
	// RoleNode is the node role for a user
	RoleNode
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bootupstate

type Bootupstate int

Bootupstate is represent the boot up state of the system

type HostData

type HostData struct {
	OS            string `bson:"os"`
	DockerVersion string `bson:"dockerVersion"`
}

HostData represents the metadata of a host machine where a kamaji-node is running

type Node

type Node struct {
	ID            string    `bson:"id"`
	TS            time.Time `bson:"ts"`
	Name          string    `json:"name"`
	LastHeartbeat time.Time `bson:"lastHeartbeat"`
	Version       string    `bson:"version"`
	HostData      HostData  `bson:"hostData"`
	Pods          []Pod     `bson:"pods"`
}

Node represents a remote kamji-node owner by a user

type Pod

type Pod struct {
	ID            string    `bson:"id"`
	TS            time.Time `bson:"ts"`
	LastHeartbeat time.Time `bson:"lastHeartbeat"`
	MultiAddr     string    `bson:"multiAddr"`
	TemplateID    int       `bson:"tplId"`
	State         string    `bson:"state"`
}

Pod reperesents a pod running on a kamaji-node

type SystemConfig

type SystemConfig struct {
	ID          string      `bson:"id"`
	BootupState Bootupstate `bson:"bootupState"`
	RootToken   string      `bson:"rootToken"`
	JWTSecret   string      `bson:"jwtToken"`
}

SystemConfig stores the config used by the system

type User

type User struct {
	ID       string    `bson:"id" json:"id"`
	TS       time.Time `bson:"ts" json:"ts"`
	Email    string    `bson:"email" json:"email"`
	Username string    `bson:"username,omitempty" json:"username"`
	Password string    `bson:"password,omitempty" json:"-"`
	RoleID   int       `bson:"roleId" json:"role"`
	Nodes    []Node    `bson:"nodes" json:"nodes"`
}

User represents a user in the system

Jump to

Keyboard shortcuts

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