module

package
v0.1.58 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 5 Imported by: 39

README

Tinysystems module

Collection of structs and interfaces to be used by module implementations

Documentation

Index

Constants

View Source
const (
	//RefreshPort target port. Useful when component wants refresh its look in cluster, triggers reconcile for the node
	RefreshPort = "_refresh"
	//HttpPort source port. Provides addressUpgrader
	HttpPort = "_http"
)

system ports

Variables

This section is empty.

Functions

func GetNodeFullName

func GetNodeFullName(prefix string, module string, component string) string

func ParseFullName

func ParseFullName(fullName string) (module string, component string, err error)

Types

type AddressUpgrade added in v0.1.25

type AddressUpgrade func(ctx context.Context, auto bool, hostnames []string, actualLocalPort int) ([]string, error)

type Component

type Component interface {
	GetInfo() ComponentInfo
	//Handle handles incoming requests
	Handle(ctx context.Context, output Handler, port string, message interface{}) error
	//Ports gets list of ports
	Ports() []NodePort
	//Instance creates new instance with default settings
	Instance() Component
}

type ComponentInfo

type ComponentInfo struct {
	Name        string
	Description string
	Info        string
	Tags        []string
}

func (ComponentInfo) GetResourceName

func (c ComponentInfo) GetResourceName() string

type Handler

type Handler func(port string, data interface{}) error

type Info

type Info struct {
	Name      string
	VersionID string // if module's build is registered
	Version   string
	Addr      string //listed address
}

func (Info) GetMajorName

func (i Info) GetMajorName() string

func (Info) GetMajorNameSanitised

func (i Info) GetMajorNameSanitised() string

func (Info) GetNameAndVersion added in v0.1.31

func (i Info) GetNameAndVersion() string

GetNameAndVersion Container image full name

type ListenAddressGetter

type ListenAddressGetter func() (suggestedPort int, upgrade AddressUpgrade)

ListenAddressGetter gets listen port address

type NodePort

type NodePort struct {
	// if that's a source port, source means it accepts the data, the source of incoming data
	Source bool
	// this port's DTO will be shown as a control panel
	Control bool
	// port with Settings equals true will be shown in configuration tab
	Settings bool
	// which side of the node will have this port
	Position Position
	// Name lower case programmatic name
	Name string
	// Human readable name (capital cased)
	Label string
	// DTO object
	Configuration interface{}
}

type Position

type Position int
const (
	Top Position = iota
	Right
	Bottom
	Left
)

Jump to

Keyboard shortcuts

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