models

package
v0.0.0-...-2601f63 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EVENT_TYPE_STATE    string = "state"
	EventTypeChange     string = "change"
	EventActionCreated  string = "created"
	EventActionUpdated  string = "updated"
	EventActionDeleted  string = "deleted"
	EventClassNamespace string = "discoveryItem/service/kubernetes/namespace"
	EventClassWorkload  string = "discoveryItem/service/kubernetes/workload"
	EventScopeFormat    string = "workspace/%s/configuration/%s"
)

Variables

This section is empty.

Functions

func GenerateRunId

func GenerateRunId() string

Types

type CommandBody

type CommandBody struct{}

type CommandBuilder

type CommandBuilder interface {
	Header(header CommandProperties) CommandBuilder
	Body(body CommandBody) CommandBuilder

	Build() CommandEvent
}

func NewCommand

func NewCommand() CommandBuilder

Command Event Builder

type CommandEvent

type CommandEvent struct {
	Properties CommandProperties `json:"properties"`
	Body       CommandBody       `json:"body"`
}

func CreateEndReplay

func CreateEndReplay(workspaceId string, config KubernetesConfig) CommandEvent

func CreateStartReplay

func CreateStartReplay(workspaceId string, config KubernetesConfig) CommandEvent

Command Events

type CommandProperties

type CommandProperties struct {
	Type   string `json:"type"`
	Scope  string `json:"scope"`
	Action string `json:"action"`
}

type DiscoveryBody

type DiscoveryBody struct {
	State State `json:"state"`
}

type DiscoveryEvent

type DiscoveryEvent struct {
	HeaderProperties HeaderProperties `json:"properties"`
	Body             DiscoveryBody    `json:"body"`
}

type HeaderProperties

type HeaderProperties struct {
	Class  string `json:"class"`
	Type   string `json:"type"`
	Scope  string `json:"scope"`
	Id     string `json:"id"`
	Action string `json:"action"`
}

type KubernetesConfig

type KubernetesConfig struct {
	ID                    string   `json:"id"`
	Cluster               string   `json:"cluster"`
	BlackListedNamespaces []string `json:"blacklistedNamespaces"`
	DiscoveryMode         string   `json:"discoveryMode"`
}

type Log

type Log struct {
	// Root        *Logger
	// Output      *Output
	RunId       string
	WorkspaceId string
}

struct to extend Log with RunId

type State

type State struct {
	Name           string      `json:"name"`
	SourceType     string      `json:"sourceType"`
	SourceInstance string      `json:"sourceInstance"`
	Time           string      `json:"time"`
	Data           interface{} `json:"data"`
}

type StatusItem

type StatusItem struct {
	ID              string      `json:"id"`
	Scope           string      `json:"scope"`
	Type            string      `json:"type"`
	Source          string      `json:"source"`
	Time            string      `json:"time"`
	DataContentType string      `json:"datacontenttype"`
	DataSchema      string      `json:"dataschema"`
	Subject         string      `json:"subject"`
	Data            interface{} `json:"data"`
}

func NewAdminLogEvent

func NewAdminLogEvent(configurationId string, runId string, workspaceId string, loglevel string, message string) *StatusItem

func NewStatusEvent

func NewStatusEvent(configurationId string, runId string, workspaceId string, runstatus string, message string) *StatusItem

Jump to

Keyboard shortcuts

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