dashboardserver

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: AGPL-3.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ListenTypeLocal            ListenType = "local"
	ListenTypeNetwork          ListenType = "network"
	DashboardServerDefaultPort int        = 9033
)

Variables

View Source
var ExecutionCompletePayloadSchemaVersion int64 = 20240130
View Source
var ExecutionStartedSchemaVersion int64 = 20240130
View Source
var LeafNodeUpdatedSchemaVersion int64 = 20240130

Functions

func OutputError

func OutputError(ctx context.Context, err error)

func OutputMessage

func OutputMessage(ctx context.Context, msg string)

func OutputReady

func OutputReady(ctx context.Context, msg string)

func OutputWait

func OutputWait(ctx context.Context, msg string)

func OutputWarning

func OutputWarning(ctx context.Context, msg string)

Types

type AvailableDashboardsPayload

type AvailableDashboardsPayload struct {
	Action     string                           `json:"action"`
	Dashboards map[string]ModAvailableDashboard `json:"dashboards"`
	Benchmarks map[string]ModAvailableBenchmark `json:"benchmarks"`
	Snapshots  map[string]string                `json:"snapshots"`
}

type ClientRequest

type ClientRequest struct {
	Action  string               `json:"action"`
	Payload ClientRequestPayload `json:"payload"`
}

type ClientRequestDashboardPayload

type ClientRequestDashboardPayload struct {
	FullName string `json:"full_name"`
}

type ClientRequestPayload

type ClientRequestPayload struct {
	Dashboard        ClientRequestDashboardPayload `json:"dashboard"`
	InputValues      map[string]interface{}        `json:"input_values"`
	ChangedInput     string                        `json:"changed_input"`
	SearchPath       []string                      `json:"search_path"`
	SearchPathPrefix []string                      `json:"search_path_prefix"`
}

type ControlEventPayload

type ControlEventPayload struct {
	Action      string                                 `json:"action"`
	Control     controlstatus.ControlRunStatusProvider `json:"control"`
	Name        string                                 `json:"name"`
	Progress    *controlstatus.ControlProgress         `json:"progress"`
	ExecutionId string                                 `json:"execution_id"`
	Timestamp   time.Time                              `json:"timestamp"`
}

type DashboardCLIMetadata

type DashboardCLIMetadata struct {
	Version string `json:"version,omitempty"`
}

type DashboardClientInfo

type DashboardClientInfo struct {
	Session         *melody.Session
	Dashboard       *string
	DashboardInputs map[string]interface{}
}

type DashboardMetadata

type DashboardMetadata struct {
	Database   string              `json:"database"`
	SearchPath *SearchPathMetadata `json:"search_path"`
}

type DashboardMetadataPayload

type DashboardMetadataPayload struct {
	Action   string            `json:"action"`
	Metadata DashboardMetadata `json:"metadata"`
}

type DisplaySnapshotPayload

type DisplaySnapshotPayload struct {
	Action        string `json:"action"`
	SchemaVersion string `json:"schema_version"`
	// snapshot is a map here as we cannot deserialise SteampipeSnapshot into a struct
	// (without custom deserialisation code) as the Panels property is an interface
	Snapshot    map[string]any `json:"snapshot"`
	ExecutionId string         `json:"execution_id"`
}

type ErrorPayload

type ErrorPayload struct {
	Action string `json:"action"`
	Error  string `json:"error"`
}

type ExecutionCompletePayload

type ExecutionCompletePayload struct {
	Action        string                             `json:"action"`
	SchemaVersion string                             `json:"schema_version"`
	Snapshot      *steampipeconfig.SteampipeSnapshot `json:"snapshot"`
	ExecutionId   string                             `json:"execution_id"`
}

type ExecutionErrorPayload

type ExecutionErrorPayload struct {
	Action    string    `json:"action"`
	Error     string    `json:"error"`
	Timestamp time.Time `json:"timestamp"`
}

type ExecutionStartedPayload

type ExecutionStartedPayload struct {
	SchemaVersion string                            `json:"schema_version"`
	Action        string                            `json:"action"`
	ExecutionId   string                            `json:"execution_id"`
	Panels        map[string]any                    `json:"panels"`
	Layout        *steampipeconfig.SnapshotTreeNode `json:"layout"`
	Inputs        map[string]interface{}            `json:"inputs,omitempty"`
	Variables     map[string]string                 `json:"variables,omitempty"`
	StartTime     time.Time                         `json:"start_time"`
}

type InputValuesClearedPayload

type InputValuesClearedPayload struct {
	Action        string   `json:"action"`
	ClearedInputs []string `json:"cleared_inputs"`
	ExecutionId   string   `json:"execution_id"`
}

type LeafNodeUpdatedPayload

type LeafNodeUpdatedPayload struct {
	SchemaVersion string         `json:"schema_version"`
	Action        string         `json:"action"`
	DashboardNode map[string]any `json:"dashboard_node"`
	ExecutionId   string         `json:"execution_id"`
	Timestamp     time.Time      `json:"timestamp"`
}

type ListenPort

type ListenPort int

func (ListenPort) IsValid

func (lp ListenPort) IsValid() error

IsValid is a validator for ListenType known values

type ListenType

type ListenType string

func (ListenType) IsValid

func (lt ListenType) IsValid() error

IsValid is a validator for ListenType known values

type ModAvailableBenchmark

type ModAvailableBenchmark struct {
	Title       string                  `json:"title,omitempty"`
	FullName    string                  `json:"full_name"`
	ShortName   string                  `json:"short_name"`
	Tags        map[string]string       `json:"tags"`
	IsTopLevel  bool                    `json:"is_top_level"`
	Children    []ModAvailableBenchmark `json:"children,omitempty"`
	Trunks      [][]string              `json:"trunks"`
	ModFullName string                  `json:"mod_full_name"`
}

type ModAvailableDashboard

type ModAvailableDashboard struct {
	Title       string            `json:"title,omitempty"`
	FullName    string            `json:"full_name"`
	ShortName   string            `json:"short_name"`
	Tags        map[string]string `json:"tags"`
	ModFullName string            `json:"mod_full_name"`
	Database    string            `json:"database"`
}

type ModMetadata

type ModMetadata struct {
	Title     string `json:"title,omitempty"`
	FullName  string `json:"full_name"`
	ShortName string `json:"short_name"`
}

type SearchPathMetadata

type SearchPathMetadata struct {
	ResolvedSearchPath   []string `json:"resolved_search_path"`
	OriginalSearchPath   []string `json:"original_search_path"`
	ConfiguredSearchPath []string `json:"configured_search_path"`
	SearchPathPrefix     []string `json:"short_name"`
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(ctx context.Context, w *dashboardworkspace.WorkspaceEvents, webSocket *melody.Melody) (*Server, error)

func (*Server) HandleDashboardEvent

func (s *Server) HandleDashboardEvent(ctx context.Context, event dashboardevents.DashboardEvent)

func (*Server) InitAsync

func (s *Server) InitAsync(ctx context.Context)

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context)

Shutdown stops the API server

func (*Server) Start

func (s *Server) Start(ctx context.Context) chan struct{}

Start starts the API server it returns a channel which is signalled when the API server terminates

type ServerMetadata

type ServerMetadata struct {
	Mod           *ModMetadata                   `json:"mod,omitempty"`
	InstalledMods map[string]*ModMetadata        `json:"installed_mods,omitempty"`
	CLI           DashboardCLIMetadata           `json:"cli"`
	Cloud         *steampipeconfig.CloudMetadata `json:"cloud,omitempty"`
	Telemetry     string                         `json:"telemetry"`
	SearchPath    *SearchPathMetadata            `json:"search_path"`
}

type ServerMetadataPayload

type ServerMetadataPayload struct {
	Action   string         `json:"action"`
	Metadata ServerMetadata `json:"metadata"`
}

Jump to

Keyboard shortcuts

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