model

package
v0.0.0-...-d07313f Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusUnknown  Status = "Unknown"
	StatusStarting        = "Starting"
	StatusStarted         = "Started"
	StatusRunning         = "Running"
	StatusStopping        = "Stopping"
	StatusStopped         = "Stopped"
)
View Source
const (
	CommandStart    = "start"
	CommandStop     = "stop"
	CommandStatus   = "status"
	CommandDownload = "download"
)
View Source
const (
	PortRead      PortKind = 1 << 1
	PortWrite              = 1 << 2
	PortReadWrite          = PortRead | PortWrite
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	LiveElement
	Type         string        `json:"type"`
	Provides     []Port        `json:"provides,omitempty"`
	Consumes     []PortId      `json:"consumes,omitempty"`
	Components   []Component   `json:"components"`
	Environments []Environment `json:"environments"`
}

type BusinessObject

type BusinessObject string

type Command

type Command struct {
	Type  string   `json:"type"`
	Steps []string `json:"steps"`
}

type CommandMap

type CommandMap map[string]Command

type Component

type Component struct {
	LiveElement
	Type     string   `json:"type"`
	Provides []Port   `json:"provides,omitempty"`
	Consumes []PortId `json:"consumes,omitempty"`
}

type Context

type Context map[string]map[string]string

type ContextExport

type ContextExport map[string]any

type Element

type Element struct {
	Id   string  `json:"id"`
	Tags *TagMap `json:"tags,omitempty"`
}

type Environment

type Environment struct {
	Context
	Id string `json:"id"`
}

func (*Environment) FormattedId

func (e *Environment) FormattedId() string

func (*Environment) MarshalJSON

func (e *Environment) MarshalJSON() ([]byte, error)

Because we want this model to follow TypeScript we need to refine marshaling / unmarshalling

func (*Environment) UnmarshalJSON

func (e *Environment) UnmarshalJSON(data []byte) error

type LiveElement

type LiveElement struct {
	Element
	Commands CommandMap `json:"commands,omitempty"`
}

func (*LiveElement) FormattedId

func (l *LiveElement) FormattedId() string

type Port

type Port struct {
	Id       string         `json:"id"`
	Object   BusinessObject `json:"object,omitempty"`
	Kind     PortKind       `json:"kind"`
	Protocol string         `json:"protocol,omitempty"`
}

type PortId

type PortId string

type PortKind

type PortKind uint8

type Status

type Status string

type StatusTrail

type StatusTrail struct {
	Status Status    `json:"status"`
	At     time.Time `json:"at"`
	By     string    `json:"by"`
	On     string    `json:"on"`
}

type TagMap

type TagMap map[string]string

Jump to

Keyboard shortcuts

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