config

package
v0.0.0-...-4503ccc Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: CC0-1.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DashboardFilterTypeUndefined = DashboardFilterType("")
	DashboardFilterTypeColor     = DashboardFilterType("color")
)
View Source
const (
	DashboardSourceImageTypeUndefined = DashboardSourceImageType("")
	DashboardSourceImageTypeDummy     = DashboardSourceImageType("dummy")
	DashboardSourceImageTypeOBSVideo  = DashboardSourceImageType("obs_video") // rename to `obs_screenshot`
	DashboardSourceImageTypeOBSVolume = DashboardSourceImageType("obs_volume")
)
View Source
const (
	ImageFormatUndefined = ImageFormat("")
	ImageFormatPNG       = ImageFormat("png")
	ImageFormatJPEG      = ImageFormat("jpeg")
	ImageFormatWebP      = ImageFormat("webp")
)

Variables

This section is empty.

Functions

func ReadConfigFromPath

func ReadConfigFromPath(
	ctx context.Context,
	cfgPath string,
	cfg *Config,
) error

func WriteConfigToPath

func WriteConfigToPath(
	ctx context.Context,
	cfgPath string,
	cfg Config,
) error

Types

type AlignX

type AlignX = consts.AlignX

type AlignY

type AlignY = consts.AlignY

type Config

type Config config

func NewConfig

func NewConfig() Config

func NewSampleConfig

func NewSampleConfig() Config

func ReadOrCreateConfigFile

func ReadOrCreateConfigFile(
	ctx context.Context,
	dataPath string,
) (*Config, error)

func (*Config) Convert

func (cfg *Config) Convert() error

func (Config) MarshalYAML

func (cfg Config) MarshalYAML() ([]byte, error)

func (*Config) Read

func (cfg *Config) Read(
	b []byte,
) (int, error)

func (*Config) ReadFrom

func (cfg *Config) ReadFrom(
	r io.Reader,
) (int64, error)

func (*Config) UnmarshalYAML

func (cfg *Config) UnmarshalYAML(b []byte) (_err error)

func (Config) Write

func (cfg Config) Write(b []byte) (int, error)

func (Config) WriteTo

func (cfg Config) WriteTo(
	w io.Writer,
) (int64, error)

type DashboardConfig

type DashboardConfig struct {
	Elements map[string]DashboardElementConfig `yaml:"elements"` // TODO: rename this to `video_elements`
}

type DashboardElementConfig

type DashboardElementConfig _RawDashboardElementConfig

func (DashboardElementConfig) MarshalYAML

func (cfg DashboardElementConfig) MarshalYAML() (b []byte, _err error)

func (*DashboardElementConfig) UnmarshalYAML

func (cfg *DashboardElementConfig) UnmarshalYAML(b []byte) (_err error)

type DashboardFilterType

type DashboardFilterType string

func (DashboardFilterType) New

func (mst DashboardFilterType) New() Filter

type DashboardSourceImageDummy

type DashboardSourceImageDummy struct{}

func (*DashboardSourceImageDummy) GetImage

func (*DashboardSourceImageDummy) SourceType

type DashboardSourceImageOBSScreenshot

type DashboardSourceImageOBSScreenshot struct {
	Name           string      `yaml:"name"            json:"name"`
	Width          float64     `yaml:"width"           json:"width"`
	Height         float64     `yaml:"height"          json:"height"`
	ImageFormat    ImageFormat `yaml:"image_format"    json:"image_format"`
	UpdateInterval Duration    `yaml:"update_interval" json:"update_interval"`
}

func (*DashboardSourceImageOBSScreenshot) GetImage

func (*DashboardSourceImageOBSScreenshot) GetImageBytes

func (*DashboardSourceImageOBSScreenshot) SourceType

type DashboardSourceImageOBSVolume

type DashboardSourceImageOBSVolume struct {
	Name           string   `yaml:"name"            json:"name"`
	UpdateInterval Duration `yaml:"update_interval" json:"update_interval"`
	ColorActive    string   `yaml:"color_active"    json:"color_active"`
	ColorPassive   string   `yaml:"color_passive"   json:"color_passive"`
}

func (*DashboardSourceImageOBSVolume) GetImage

func (*DashboardSourceImageOBSVolume) SourceType

type DashboardSourceImageType

type DashboardSourceImageType string

func (DashboardSourceImageType) New

type Duration

type Duration time.Duration

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

type Event

type Event = event.Event

type EventQuery

type EventQuery = eventquery.EventQuery

type Filter

type Filter interface {
	Filter(context.Context, image.Image) image.Image
	DashboardFilterType() DashboardFilterType
}

type FilterColor

type FilterColor struct {
	Brightness float64 `yaml:"brightness" json:"brightness"`
	Opacity    float64 `yaml:"opacity"    json:"opacity"`
}

func (*FilterColor) DashboardFilterType

func (f *FilterColor) DashboardFilterType() DashboardFilterType

func (*FilterColor) Filter

func (f *FilterColor) Filter(
	ctx context.Context,
	img image.Image,
) image.Image

type GetImageByteser

type GetImageByteser interface {
	GetImageBytes(
		ctx context.Context,
		obsServer obs_grpc.OBSServer,
		el DashboardElementConfig,
	) ([]byte, string, time.Time, error)
}

type GitRepoConfig

type GitRepoConfig struct {
	Enable           *bool
	URL              string        `yaml:"url,omitempty"`
	PrivateKey       secret.String `yaml:"private_key,omitempty"`
	LatestSyncCommit string        `yaml:"latest_sync_commit,omitempty"` // TODO: deprecate this field, it's just a non-needed mechanism (better to check against git history).
}

type ImageFormat

type ImageFormat string

type P2PNetwork

type P2PNetwork struct {
	NetworkID  string        `yaml:"network_id"`
	PeerName   string        `yaml:"peer_name"`
	PrivateKey P2PPrivateKey `yaml:"private_key"`
	PSK        secret.Bytes  `yaml:"psk"`
	VPN        P2PVPNConfig  `yaml:"vpn"`
}

func GetRandomP2PConfig

func GetRandomP2PConfig() P2PNetwork

func (*P2PNetwork) IsZero

func (cfg *P2PNetwork) IsZero() bool

type P2PPrivateKey

type P2PPrivateKey struct {
	ED25519 secret.Bytes `yaml:"ed25519"`
}

func (*P2PPrivateKey) Get

func (cfg *P2PPrivateKey) Get() (crypto.PrivateKey, error)

type P2PVPNConfig

type P2PVPNConfig struct {
	Network string `yaml:"network"`
}

type ProfileMetadata

type ProfileMetadata struct {
	DefaultStreamTitle       string
	DefaultStreamDescription string
	MaxOrder                 int
}

type SourceImage

type SourceImage interface {
	GetImage(
		ctx context.Context,
		obsServer obs_grpc.OBSServer,
		el DashboardElementConfig,
		obsState *streamtypes.OBSState,
	) (image.Image, time.Time, error)

	SourceType() DashboardSourceImageType
}

type TriggerRule

type TriggerRule struct {
	Description string                `yaml:"description,omitempty" json:"description,omitempty"`
	EventQuery  eventquery.EventQuery `yaml:"trigger"               json:"trigger"`
	Action      action.Action         `yaml:"action"                json:"action"`
}

func (TriggerRule) MarshalYAML

func (tr TriggerRule) MarshalYAML() (b []byte, _err error)

func (*TriggerRule) String

func (tr *TriggerRule) String() string

func (*TriggerRule) UnmarshalYAML

func (tr *TriggerRule) UnmarshalYAML(b []byte) (_err error)

type TriggerRules

type TriggerRules []*TriggerRule

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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