models

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2019 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateLogFile

func CreateLogFile(uuid string, name string, note string, env *utils.Env) error

CreateLogFile creates a new logfile in the database It also creates a log file and a note file if available on the system

Types

type Axis

type Axis struct {
	Name       string `json:"name" validate:"required"`
	Title      string `json:"title" validate:"required"`
	Range      []int  `json:"range" validate:"min=1"`
	Side       string `json:"side"`
	Overlaying string `json:"overlaying" validate:"oneof y x"`
}

type BlackListedToken

type BlackListedToken struct {
	ID         int    `storm:"id,increment"`
	Token      string `storm:"unique"`
	Expiration int64
}

type Chart

type Chart struct {
	UUID                string                `storm:"id" json:"uuid" validate:"uuid"`
	Title               string                `json:"title" validate:"required"`
	PlotDataInformation []PlotDataInformation `json:"plotDataInformation"`
	Axes                []Axis                `json:"axes"`
	HorizontalRulers    []HRuler              `json:"horizontalRulers"`
	VerticalRulers      []VRuler              `json:"verticalRulers"`
	Image               string                `json:"image" validate:"datauri"`
}

Chart with the needed properties to generate a chart in the frontend swagger:model Chart

type Config

type Config struct {
	ID          int  `storm:"id,increment" json:"id"`
	OpenNetwork bool `json:"openNetwork"`
	UserCreated bool `json:"userCreated"`
}

Config model that keep tracks of application configuration swagger:model ConfigResponse

type HRuler

type HRuler struct {
	Ruler
	Y int `json:"y" validate:"required"`
}

type LogFile

type LogFile struct {
	UUID      string `storm:"id" json:"uuid"`
	Name      string `json:"name"`
	FileName  string `json:"filename"`
	Timestamp int64  `json:"timestamp"`
	HasNote   bool   `json:"hasNote"`
}

A logFile database model

This is used to save a logFile in the boltdb

func (*LogFile) AppendLog

func (logFile *LogFile) AppendLog(logData string, env *utils.Env) error

AppendLog appends new information to an already existing log file.

func (*LogFile) DeleteLogFile

func (logFile *LogFile) DeleteLogFile(env *utils.Env) error

DeleteLogFile

func (*LogFile) GetFileName

func (logFile *LogFile) GetFileName() string

GetFileName returns the filename to use

func (*LogFile) UpdateLogFile

func (logFile *LogFile) UpdateLogFile(name string, note string, env *utils.Env) error

UpdateLogFile updates the name and notes

type PlotDataInformation

type PlotDataInformation struct {
	DataName string `json:"dataName" validate:"required"`
	PlotName string `json:"plotName" validate:"required"`
	Color    string `json:"color" validate:"required" validate:"hexcolor"`
	Axis     string `json:"axis" validate:"oneof y0 y1 y2"`
}

type Ruler

type Ruler struct {
	Text   string `json:"text" validate:"required"`
	Width  int    `json:"width" validate:"required"`
	Color  string `json:"color" validate:"hexcolor"`
	Filler bool   `json:"filler"`
}

type Sheet

type Sheet struct {
	UUID   string   `storm:"id" json:"uuid" validate:"uuid"`
	Title  string   `json:"title" validate:"required"`
	Charts []string `json:"charts" validate:"dive,chart-exists"`
}

type User

type User struct {
	UUID            string `storm:"id" json:"uuid" validate:"uuid"`
	Username        string `json:"username" storm:"unique" validate:"required,email"`
	Password        string `json:"password" validate:"required,min=8"`
	TrackingAllowed bool   `json:"trackingAllowed"`
}

type VRuler

type VRuler struct {
	Ruler
	X int `json:"x" validate:"required"`
}

type Workspace

type Workspace struct {
	UUID   string   `storm:"id" json:"uuid" validate:"uuid"`
	Title  string   `json:"title" validate:"required"`
	Sheets []string `json:"sheets" validate:"dive,sheet-exists"`
}

Jump to

Keyboard shortcuts

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