types

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

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

Go to latest
Published: Jun 10, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIDForRegex

func GetIDForRegex(id string) string

GetIDForRegex escapes special chars in the id for regex usage.

func GetShortID

func GetShortID(id string) string

GetShortID for children ref

func GetTargetParentByID

func GetTargetParentByID(id string) string

GetTargetParentByID obtains the parent ID of a target given its ID

Types

type AWSJobDefinition

type AWSJobDefinition struct {
	LambdaArn string `json:"lambdaArn,omitempty" bson:",omitempty" yaml:"lambda_arn"`
	Event     string `json:"event,omitempty" bson:",omitempty" yaml:"event"`
}

AWSServerlessDefinition is an AWS Lambda Serverless definition

type AuthRequest

type AuthRequest struct {
	Email    string `json:"email" binding:"required"`
	Password string `json:"password" binding:"required"`
}

type DockerJobDefinition

type DockerJobDefinition struct {
	Image   string            `json:"image,omitempty" bson:",omitempty" yaml:"image"`
	Command string            `json:"command,omitempty" bson:",omitempty" yaml:"command"`
	Env     map[string]string `json:"env,omitempty" bson:",omitempty" yaml:"env"`
	Volumes map[string]string `json:"volumes,omitempty" bson:",omitempty" yaml:"volumes"`
}

DockerDefinition is a Docker task definition

type Job

type Job struct {
	ID          string            `json:"id"`
	TargetId    string            `json:"targetId"`
	Label       string            `json:"label"`
	Props       map[string]string `json:"props"`
	Status      int               `json:"status"`
	SchedulerId string            `json:"schedulerId"`
	UpdatedAt   time.Time         `json:"updatedAt" time_format:"unix"`
}

type K8SJobDefinition

type K8SJobDefinition struct {
	Pod *DockerJobDefinition `json:"pod,omitempty" bson:",omitempty" yaml:"pod"`
}

K8SDefinition is a Kubernetes task definition

type Monitor

type Monitor struct {
	ID          string                `json:"id" binding:"required" yaml:"id"`
	Label       string                `json:"label" binding:"required" yaml:"label"`
	Schedule    string                `json:"schedule" binding:"required" yaml:"schedule"`
	Description string                `json:"description,omitempty" bson:",omitempty" yaml:"description"`
	Definition  *MonitorJobDefinition `json:"definition" binding:"required" yaml:"definition"`
	Permissions `yaml:",inline"`
}

Monitor is a monitor definition to be assigned to targets

type MonitorJobDefinition

type MonitorJobDefinition struct {
	Docker *DockerJobDefinition `json:"docker,omitempty" bson:",omitempty" yaml:"docker"`
	K8S    *K8SJobDefinition    `json:"k8s,omitempty" bson:",omitempty" yaml:"k8s"`
	AWS    *AWSJobDefinition    `json:"aws,omitempty" bson:",omitempty" yaml:"aws"`
	Shell  *ShellJobDefinition  `json:"shell,omitempty" bson:",omitempty" yaml:"shell"`
}

MonitorJobDefinition is a definition of a monitor

type MonitorRef

type MonitorRef struct {
	MonitorID string            `json:"monitorId,omitempty" bson:"monitorId" yaml:"monitorId"`
	Params    map[string]string `json:"params,omitempty" bson:",omitempty" yaml:"params,omitempty"`
}

MonitorRef is a reference to an existing monitor

type Permissions

type Permissions struct {
	Owners    []string  `json:"owners" yaml:"owners"`
	Readers   []string  `json:"readers" yaml:"readers"`
	Writers   []string  `json:"writers" yaml:"writers"`
	CreatedAt time.Time `json:"createdAt" bson:"createdAt" time_format:"unix"`
	UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt" time_format:"unix"`
}

Permissions for all objects

type Role

type Role struct {
	Name        string `json:"name" yaml:"name" binding:"required"`
	Description string `json:"description" yaml:"description" binding:"required"`
	Permissions `yaml:",inline"`
}

type RoleUpdateRequest

type RoleUpdateRequest struct {
	UsersAdd    []string `json:"usersAdd,omitempty" yaml:"usersAdd,omitempty"`
	UsersRemove []string `json:"usersRemove,omitempty" yaml:"usersRemove,omitempty"`
	Permissions
}

type Scheduler

type Scheduler struct {
	ID       string    `json:"id"`
	Label    string    `json:"label"`
	LastPing time.Time `json:"lastPing" time_format:"unix"`
}

type ShellJobDefinition

type ShellJobDefinition struct {
	Command    string            `json:"command,omitempty" bson:",omitempty" yaml:"command"`
	Executable string            `json:"executable,omitempty" bson:",omitempty" yaml:"executable"`
	Env        map[string]string `json:"env,omitempty" bson:",omitempty" yaml:"env"`
}

ShellDefinition is a Shell command definition

type Target

type Target struct {
	ID                string      `json:"id" yaml:"id" binding:"required"`
	Description       string      `json:"description" yaml:"description" binding:"required"`
	URL               string      `json:"url,omitempty" yaml:"url,omitempty" bson:",omitempty"`
	Status            int         `json:"status" yaml:"status"`
	StatusDescription string      `json:"statusDescription,omitempty" yaml:"statusDescription,omitempty" bson:"statusDescription,omitempty"`
	Critical          bool        `json:"critical" yaml:"critical"`
	Monitor           *MonitorRef `json:"monitor,omitempty" bson:",omitempty"`
	Children          []TargetRef `json:"children,omitempty" yaml:"children,omitempty" bson:",omitempty"`
	ChildrenRef       []string    `json:"childrenRef,omitempty" bson:",omitempty"`
	Permissions       `yaml:",inline"`
}

Target full object

type TargetList

type TargetList []*Target

TargetList for sorting targets by ID

func (TargetList) Len

func (s TargetList) Len() int

func (TargetList) Less

func (s TargetList) Less(i, j int) bool

func (TargetList) Swap

func (s TargetList) Swap(i, j int)

type TargetPatch

type TargetPatch struct {
	Status            int    `json:"status" binding:"required"`
	StatusDescription string `json:"statusDescription"`
}

TargetPatch represents the fields that can be patched

type TargetRef

type TargetRef *Target

type User

type User struct {
	Email       string `json:"email" yaml:"email" binding:"required"`
	FullName    string `json:"fullName" yaml:"fullName"`
	PassHash    string
	FirstHash   string   `json:"firstHash"`
	Roles       []string `json:"roles,omitempty" yaml:"roles,omitempty"`
	Permissions `yaml:",inline"`
}

type UserToken

type UserToken struct {
	Email      string    `json:"email" binding:"required"`
	Token      string    `json:"token" binding:"required" bson:"token"`
	Expiration time.Time `json:"expiration" binding:"required"`
}

type UserTokenRequest

type UserTokenRequest struct {
	Expiration time.Time `json:"expiration" time_format:"unix"`
}

type UserUpdateRequest

type UserUpdateRequest struct {
	FullName    string `json:"fullName,omitempty" yaml:"fullName,omitempty"`
	OldPassword string `json:"oldPassword,omitempty" yaml:"fullName,omitempty"`
	NewPassword string `json:"newPassword,omitempty" yaml:"password,omitempty"`
	Permissions
}

Jump to

Keyboard shortcuts

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