setupData

package
v0.0.0-...-2e08161 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2025 License: GPL-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Data      *SetupData
	Active    bool = false
	BaseID    string
	ServiceID uint64
	Port      uint32 = 50001
)

Functions

func FreeTCPPort

func FreeTCPPort() net.Listener

Types

type AdminPathItem

type AdminPathItem struct {
	Path          string
	PostAllowed   bool
	GetDisabled   bool
	AllowedPanels []string
	Call          PageFunc
}

type EmbedInterface

type EmbedInterface interface {
	Open(name string) (fs.File, error)
	ReadFile(name string) ([]byte, error)
}

type HorizontalAlignType

type HorizontalAlignType int8
const (
	HCenter HorizontalAlignType = iota
	HLeft
	HRight
)

type PageFunc

type PageFunc = func(in *structs.WebRequest) (*structs.WebReturn, error)

type PanelFunc

type PanelFunc = func(in *structs.PanelRequest) (*structs.PanelReturn, error)

type PanelItem

type PanelItem struct {
	Name              string
	Label             string
	Description       string
	Layout            PanelLayout
	AdminOnly         bool
	Permission        string
	AllowedPaths      []string
	RequiredVariables []RequiredVariable

	HTMLCall   PanelFunc
	SocketCall SocketFunc
}

type PanelLayout

type PanelLayout struct {
	HorizontalAlign HorizontalAlignType
	VerticalAlign   VerticalAlignType
	Width           uint32
	Height          uint32
	ScrollWidth     bool
	ScrollHeight    bool
	TitleBar        bool
	Minimise        bool
	Close           bool
}

type PathItem

type PathItem struct {
	Path          string
	Permission    string
	PostAllowed   bool
	GetDisabled   bool
	AllowedPanels []string
	Call          PageFunc
}

type RequiredVariable

type RequiredVariable struct {
	Name    string
	Options []string
}

type SetupData

type SetupData struct {
	ServiceName      string
	ServiceType      string
	Version          structs.Version
	Multi            bool
	SingleRun        bool
	StartActive      bool
	NavItems         []*pb.NavItem
	ConfigItems      []*pb.ConfigItem
	RequiredServices []*pb.RequiredService
	Groups           []string
	Permissions      []string
	VerboseLog       bool
	GRPCSystems      func(server *grpc.Server)

	StaticFS            EmbedInterface
	AdminPaths          []*AdminPathItem
	Paths               []*PathItem
	Sockets             []*SocketItem
	Panels              []*PanelItem
	TaskGrabber         func() []*pbw.TaskMessage
	NotificationGrabber func() []*pbw.NotificationMessage
	MainSetup           func()
	MainSystem          func()
	MainShutdown        func()
	// contains filtered or unexported fields
}

func (*SetupData) AdminPathsToProtos

func (d *SetupData) AdminPathsToProtos() []*pb.AdminWebLinkItem

func (*SetupData) Filename

func (d *SetupData) Filename(extension string) string

func (*SetupData) GetAdminPath

func (d *SetupData) GetAdminPath(path string) *AdminPathItem

func (*SetupData) GetPanel

func (d *SetupData) GetPanel(name string) *PanelItem

func (*SetupData) GetPath

func (d *SetupData) GetPath(path string) *PathItem

func (*SetupData) GetSocket

func (d *SetupData) GetSocket(command string) *SocketItem

func (*SetupData) Name

func (d *SetupData) Name() string

func (*SetupData) PanelsToProtos

func (d *SetupData) PanelsToProtos() []*pb.PanelSetup

func (*SetupData) PathsToProtos

func (d *SetupData) PathsToProtos() []*pb.WebLinkItem

func (*SetupData) RegisterProto

func (d *SetupData) RegisterProto() *pb.RegisterRequest

func (*SetupData) SocketsToProtos

func (d *SetupData) SocketsToProtos() []*pb.WebSocketItem

func (*SetupData) URL

func (d *SetupData) URL() string

type SocketFunc

type SocketFunc = func(in *structs.SocketRequest) (*structs.SocketReturn, error)

type SocketItem

type SocketItem struct {
	Command           string
	Permission        string
	AdminOnly         bool
	RequiredVariables []string
	Call              SocketFunc
}

type VerticalAlignType

type VerticalAlignType int8
const (
	VCenter VerticalAlignType = iota
	VTop
	VBottom
)

Jump to

Keyboard shortcuts

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