dashboardserver

package
v0.13.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2022 License: AGPL-3.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunForService

func RunForService(ctx context.Context, serverListen ListenType, serverPort ListenPort) error

func StartAPI

func StartAPI(ctx context.Context, webSocket *melody.Melody) *http.Server

func StopDashboardService

func StopDashboardService(ctx context.Context) error

func WriteServiceStateFile

func WriteServiceStateFile(state *DashboardServiceState) error

Types

type AvailableDashboardsPayload

type AvailableDashboardsPayload struct {
	Action          string                                      `json:"action"`
	DashboardsByMod map[string]map[string]ModAvailableDashboard `json:"dashboards_by_mod"`
}

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"`
}

type DashboardClientInfo

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

type DashboardMetadata

type DashboardMetadata struct {
	Mod           ModDashboardMetadata            `json:"mod"`
	InstalledMods map[string]ModDashboardMetadata `json:"installed_mods,omitempty"`
	Cloud         *steampipeconfig.CloudMetadata  `json:"cloud,omitempty"`
	Telemetry     string                          `json:"telemetry"`
}

type DashboardMetadataPayload

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

type DashboardServiceState

type DashboardServiceState struct {
	State      ServiceState
	Error      string
	Pid        int
	Port       int
	ListenType string
	Listen     []string
}

func GetDashboardServiceState

func GetDashboardServiceState() (*DashboardServiceState, error)

type ErrorPayload

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

type ExecutionPayload

type ExecutionPayload struct {
	Action        string                               `json:"action"`
	DashboardNode dashboardinterfaces.DashboardNodeRun `json:"dashboard_node"`
}

type InputValuesClearedPayload

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

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
const (
	ListenTypeLocal   ListenType = "local"
	ListenTypeNetwork ListenType = "network"
)

func (ListenType) IsValid

func (lt ListenType) IsValid() error

IsValid is a validator for ListenType known values

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"`
}

type ModDashboardMetadata

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

type Server

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

func NewServer

func NewServer(ctx context.Context, dbClient db_common.Client, w *workspace.Workspace) (*Server, error)

func (*Server) HandleWorkspaceUpdate

func (s *Server) HandleWorkspaceUpdate(event dashboardevents.DashboardEvent)

func (*Server) Init

func (s *Server) Init(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()

Start starts the API server

type ServiceState

type ServiceState string
const (
	ServiceStateRunning ServiceState = "running"
	ServiceStateError   ServiceState = "running"
)

Jump to

Keyboard shortcuts

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