Documentation ¶
Index ¶
- Constants
- func AssertStreamProfile[T StreamProfile](ctx context.Context, v AbstractStreamProfile) (*T, error)
- func ConvertAbstractStreamProfiles(s StreamProfiles[AbstractStreamProfile], platID PlatformName) error
- func ConvertPlatformConfigInplace(cfg Config, platID PlatformName) error
- func ConvertStreamProfiles[T StreamProfile](ctx context.Context, m map[ProfileName]AbstractStreamProfile) error
- func GetPlatformSpecificConfig[T PlatformSpecificConfig](ctx context.Context, platCfgCfg any) T
- func GetStreamProfile[T StreamProfile](ctx context.Context, v AbstractStreamProfile) (*T, error)
- func InitConfig[T PlatformSpecificConfig, S StreamProfile](cfg Config, id PlatformName, platCfg PlatformConfig[T, S])
- func IsInitialized(cfg Config, platID PlatformName) bool
- func RegisterPlatform[PSC PlatformSpecificConfig, SP StreamProfile](id PlatformName)
- func ToAbstractStreamProfiles[S StreamProfile](in map[ProfileName]S) map[ProfileName]AbstractStreamProfile
- type AbstractPlatformConfig
- type AbstractStreamController
- type AbstractStreamProfile
- type Capability
- type ChatMessage
- type ChatMessageID
- type ChatUserID
- type Config
- type ErrInvalidStreamProfileType
- type ErrNoStreamControllerForProfile
- type PlatformConfig
- type PlatformName
- type PlatformSpecificConfig
- type ProfileName
- type RawMessage
- func (RawMessage) GetOrder() int
- func (RawMessage) GetParent() (ProfileName, bool)
- func (RawMessage) IsInitialized() bool
- func (m RawMessage) MarshalJSON() ([]byte, error)
- func (m RawMessage) MarshalYAML() ([]byte, error)
- func (m *RawMessage) UnmarshalJSON(b []byte) error
- func (m *RawMessage) UnmarshalYAML(b []byte) error
- type StreamController
- type StreamControllerCommons
- type StreamControllers
- func (s StreamControllers) ApplyProfiles(ctx context.Context, profiles []AbstractStreamProfile) error
- func (s StreamControllers) EndStream(ctx context.Context) error
- func (s StreamControllers) Flush(ctx context.Context) error
- func (s StreamControllers) InsertAdsCuePoint(ctx context.Context, ts time.Time, duration time.Duration) error
- func (s StreamControllers) SetDescription(ctx context.Context, description string) error
- func (s StreamControllers) SetTitle(ctx context.Context, title string) error
- func (s StreamControllers) StartStream(ctx context.Context, title string, description string, ...) error
- type StreamProfile
- type StreamProfileBase
- type StreamProfiles
- type StreamStatus
Constants ¶
View Source
const ( CapabilityUndefined = Capability(iota) CapabilitySendChatMessage CapabilityDeleteChatMessage CapabilityBanUser EndOfCapability )
Variables ¶
This section is empty.
Functions ¶
func AssertStreamProfile ¶
func AssertStreamProfile[T StreamProfile]( ctx context.Context, v AbstractStreamProfile, ) (*T, error)
func ConvertAbstractStreamProfiles ¶
func ConvertAbstractStreamProfiles( s StreamProfiles[AbstractStreamProfile], platID PlatformName, ) error
func ConvertPlatformConfigInplace ¶
func ConvertPlatformConfigInplace( cfg Config, platID PlatformName, ) error
func ConvertStreamProfiles ¶
func ConvertStreamProfiles[T StreamProfile]( ctx context.Context, m map[ProfileName]AbstractStreamProfile, ) error
func GetPlatformSpecificConfig ¶
func GetPlatformSpecificConfig[T PlatformSpecificConfig]( ctx context.Context, platCfgCfg any, ) T
func GetStreamProfile ¶
func GetStreamProfile[T StreamProfile]( ctx context.Context, v AbstractStreamProfile, ) (*T, error)
func InitConfig ¶
func InitConfig[T PlatformSpecificConfig, S StreamProfile](cfg Config, id PlatformName, platCfg PlatformConfig[T, S])
func IsInitialized ¶
func IsInitialized( cfg Config, platID PlatformName, ) bool
func RegisterPlatform ¶
func RegisterPlatform[PSC PlatformSpecificConfig, SP StreamProfile](id PlatformName)
func ToAbstractStreamProfiles ¶
func ToAbstractStreamProfiles[S StreamProfile]( in map[ProfileName]S, ) map[ProfileName]AbstractStreamProfile
Types ¶
type AbstractPlatformConfig ¶
type AbstractPlatformConfig = PlatformConfig[PlatformSpecificConfig, AbstractStreamProfile]
func ToAbstractPlatformConfig ¶
func ToAbstractPlatformConfig[T PlatformSpecificConfig, S StreamProfile]( ctx context.Context, platCfg *PlatformConfig[T, S], ) *AbstractPlatformConfig
type AbstractStreamController ¶
type AbstractStreamController interface { StreamController[AbstractStreamProfile] GetImplementation() StreamControllerCommons StreamProfileType() reflect.Type }
func ToAbstract ¶
func ToAbstract[T StreamProfile](c StreamController[T]) AbstractStreamController
type AbstractStreamProfile ¶
type AbstractStreamProfile interface { GetParent() (ProfileName, bool) GetOrder() int }
type Capability ¶
type Capability uint
type ChatMessage ¶
type ChatMessage struct { CreatedAt time.Time UserID ChatUserID Username string MessageID ChatMessageID Message string }
type ChatMessageID ¶
type ChatMessageID string
type ChatUserID ¶
type ChatUserID string
type ErrInvalidStreamProfileType ¶
type ErrInvalidStreamProfileType struct { Received AbstractStreamProfile Expected AbstractStreamProfile }
func (ErrInvalidStreamProfileType) Error ¶
func (e ErrInvalidStreamProfileType) Error() string
type ErrNoStreamControllerForProfile ¶
type ErrNoStreamControllerForProfile struct {
StreamProfile AbstractStreamProfile
}
func (ErrNoStreamControllerForProfile) Error ¶
func (e ErrNoStreamControllerForProfile) Error() string
type PlatformConfig ¶
type PlatformConfig[T PlatformSpecificConfig, S StreamProfile] struct { Enable *bool Config T StreamProfiles StreamProfiles[S] Custom map[string]any }
func ConvertPlatformConfig ¶
func ConvertPlatformConfig[T PlatformSpecificConfig, S StreamProfile]( ctx context.Context, platCfg *AbstractPlatformConfig, ) *PlatformConfig[T, S]
func GetPlatformConfig ¶
func GetPlatformConfig[T PlatformSpecificConfig, S StreamProfile]( ctx context.Context, cfg Config, id PlatformName, ) *PlatformConfig[T, S]
func (*PlatformConfig[T, S]) GetCustomString ¶
func (cfg *PlatformConfig[T, S]) GetCustomString(key string) (string, bool)
func (PlatformConfig[T, S]) GetStreamProfile ¶
func (cfg PlatformConfig[T, S]) GetStreamProfile(name ProfileName) (S, bool)
func (*PlatformConfig[T, S]) IsInitialized ¶
func (cfg *PlatformConfig[T, S]) IsInitialized() bool
func (*PlatformConfig[T, S]) SetCustomString ¶
func (cfg *PlatformConfig[T, S]) SetCustomString(key string, value any) bool
type PlatformName ¶
type PlatformName string
type PlatformSpecificConfig ¶
type PlatformSpecificConfig interface {
IsInitialized() bool
}
func GetAbstractPlatformSpecificConfig ¶
func GetAbstractPlatformSpecificConfig( cfg Config, platID PlatformName, ) (PlatformSpecificConfig, error)
type ProfileName ¶
type ProfileName string
type RawMessage ¶
type RawMessage json.RawMessage
func (RawMessage) GetOrder ¶
func (RawMessage) GetOrder() int
func (RawMessage) GetParent ¶
func (RawMessage) GetParent() (ProfileName, bool)
func (RawMessage) IsInitialized ¶
func (RawMessage) IsInitialized() bool
func (RawMessage) MarshalJSON ¶
func (m RawMessage) MarshalJSON() ([]byte, error)
func (RawMessage) MarshalYAML ¶
func (m RawMessage) MarshalYAML() ([]byte, error)
func (*RawMessage) UnmarshalJSON ¶
func (m *RawMessage) UnmarshalJSON(b []byte) error
func (*RawMessage) UnmarshalYAML ¶
func (m *RawMessage) UnmarshalYAML(b []byte) error
type StreamController ¶
type StreamControllerCommons ¶
type StreamControllerCommons interface { io.Closer SetTitle(ctx context.Context, title string) error SetDescription(ctx context.Context, description string) error InsertAdsCuePoint(ctx context.Context, ts time.Time, duration time.Duration) error Flush(ctx context.Context) error EndStream(ctx context.Context) error GetStreamStatus(ctx context.Context) (*StreamStatus, error) GetChatMessagesChan(ctx context.Context) (<-chan ChatMessage, error) SendChatMessage(ctx context.Context, message string) error RemoveChatMessage(ctx context.Context, messageID ChatMessageID) error BanUser(ctx context.Context, userID ChatUserID, reason string, deadline time.Time) error IsCapable(context.Context, Capability) bool }
type StreamControllers ¶
type StreamControllers []AbstractStreamController
func (StreamControllers) ApplyProfiles ¶
func (s StreamControllers) ApplyProfiles( ctx context.Context, profiles []AbstractStreamProfile, ) error
func (StreamControllers) EndStream ¶
func (s StreamControllers) EndStream( ctx context.Context, ) error
func (StreamControllers) InsertAdsCuePoint ¶
func (StreamControllers) SetDescription ¶
func (s StreamControllers) SetDescription( ctx context.Context, description string, ) error
func (StreamControllers) SetTitle ¶
func (s StreamControllers) SetTitle( ctx context.Context, title string, ) error
func (StreamControllers) StartStream ¶
func (s StreamControllers) StartStream( ctx context.Context, title string, description string, profiles []AbstractStreamProfile, customArgs ...any, ) error
type StreamProfile ¶
type StreamProfile interface { AbstractStreamProfile }
func ConvertStreamProfile ¶
func ConvertStreamProfile( p StreamProfile, platID PlatformName, ) (StreamProfile, error)
type StreamProfileBase ¶
type StreamProfileBase struct { Parent ProfileName Order int }
func (StreamProfileBase) GetOrder ¶
func (profile StreamProfileBase) GetOrder() int
func (StreamProfileBase) GetParent ¶
func (profile StreamProfileBase) GetParent() (ProfileName, bool)
func (*StreamProfileBase) SetOrder ¶
func (profile *StreamProfileBase) SetOrder(v int)
type StreamProfiles ¶
type StreamProfiles[S StreamProfile] map[ProfileName]S
func GetStreamProfiles ¶
func GetStreamProfiles[S StreamProfile]( streamProfiles map[ProfileName]AbstractStreamProfile, ) StreamProfiles[S]
func (StreamProfiles[S]) Get ¶
func (profiles StreamProfiles[S]) Get(name ProfileName) (S, bool)
Click to show internal directories.
Click to hide internal directories.