domain

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2025 License: AGPL-3.0-or-later Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContainerStatusPulling    = "pulling" // Does not correspond to a Docker status.
	ContainerStatusCreated    = "created"
	ContainerStatusRunning    = "running"
	ContainerStatusPaused     = "paused"
	ContainerStatusRestarting = "restarting"
	ContainerStatusRemoving   = "removing"
	ContainerStatusExited     = "exited"
	ContainerStatusDead       = "dead"
)

Container status strings.

TODO: refactor to strictly reflect Docker status strings.

View Source
const AppName = "octoplex"

AppName is the name of the app.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppState

type AppState struct {
	Source       Source
	Destinations []Destination
	BuildInfo    BuildInfo
}

AppState holds application state.

func (*AppState) Clone

func (s *AppState) Clone() AppState

Clone performs a deep copy of AppState.

type BuildInfo

type BuildInfo struct {
	GoVersion string
	Version   string
	Commit    string
	Date      string
}

BuildInfo holds information about the build.

type Container

type Container struct {
	ID               string
	Status           string
	HealthState      string
	CPUPercent       float64
	MemoryUsageBytes uint64
	RxRate           int
	TxRate           int
	RxSince          time.Time
	ImageName        string
	PullStatus       string // PullStatus is the status of the image pull.
	PullProgress     string // PullProgress is the "progress string" of the image pull.
	PullPercent      int    // PullPercent is the percentage of the image that has been pulled.
	RestartCount     int
	ExitCode         *int
	Err              error // Err is set if any error was received from the container client.
}

Container represents the current state of an individual container.

type Destination

type Destination struct {
	Container Container
	Status    DestinationStatus
	ID        uuid.UUID
	Name      string
	URL       string
}

Destination is a single destination.

type DestinationStatus

type DestinationStatus int

DestinationStatus reflects the high-level status of a single destination.

const (
	DestinationStatusOffAir DestinationStatus = iota
	DestinationStatusStarting
	DestinationStatusLive
)

func (DestinationStatus) String added in v0.0.12

func (s DestinationStatus) String() string

String implements the fmt.Stringer interface for DestinationStatus.

type KeyPair added in v0.0.8

type KeyPair struct {
	Cert, Key []byte
}

KeyPair holds a TLS key pair.

func (KeyPair) IsZero added in v0.0.8

func (k KeyPair) IsZero() bool

IsZero returns true if the KeyPair is zero value.

type KeyPairs added in v0.0.10

type KeyPairs struct {
	Internal KeyPair // valid for localhost and any user-provided host
	Custom   KeyPair // valid only for any user-provided host, may be zero value
}

KeyPairs holds TLS key pairs for the server.

func (KeyPairs) External added in v0.0.10

func (k KeyPairs) External() KeyPair

External returns the external key pair, which is the custom key pair if it exists or the internal key pair otherwise.

type NetAddr added in v0.0.8

type NetAddr struct {
	IP   string
	Port int
}

NetAddr holds a network address.

func (NetAddr) IsZero added in v0.0.8

func (n NetAddr) IsZero() bool

IsZero returns true if the NetAddr is zero value.

type Source

type Source struct {
	Container     Container
	Live          bool
	LiveChangedAt time.Time
	Tracks        []string
	RTMPURL       string
	RTMPSURL      string
	ExitReason    string
}

Source represents the source, currently always the mediaserver.

type Token added in v0.0.15

type Token struct {
	Hashed    string
	ExpiresAt time.Time // may be zero value, meaning no expiration
}

Token represents a token used for API authentication or session management.

Jump to

Keyboard shortcuts

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