kick

package
v0.0.0-...-646ff60 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: CC0-1.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ID = kick.ID

Variables

This section is empty.

Functions

func CtxWithCache

func CtxWithCache(ctx context.Context, cache *Cache) context.Context

func InitConfig

func InitConfig(cfg streamctl.Config)

Types

type Cache

type Cache struct {
	ChanInfo *kickcom.ChannelV1
}

func CacheFromCtx

func CacheFromCtx(ctx context.Context) *Cache

func (*Cache) GetChanInfo

func (cache *Cache) GetChanInfo() *kickcom.ChannelV1

func (*Cache) SetChanInfo

func (cache *Cache) SetChanInfo(chanInfo *kickcom.ChannelV1)

type ChatClient

type ChatClient interface {
	GetChatMessagesV2(
		ctx context.Context,
		channelID uint64,
		cursor uint64,
	) (*kickcom.ChatMessagesV2Reply, error)
}

type ChatHandler

type ChatHandler struct {
	// contains filtered or unexported fields
}

func NewChatHandler

func NewChatHandler(
	ctx context.Context,
	chatClient Client,
	channelID uint64,
) (*ChatHandler, error)

func (*ChatHandler) MessagesChan

func (h *ChatHandler) MessagesChan() <-chan streamcontrol.ChatMessage

type Client

type Client interface {
	ChatClient
	LivestreamInfoClient
}

type Config

type Config = kick.Config

type Kick

type Kick struct {
	CloseCtx    context.Context
	CloseFn     context.CancelFunc
	Channel     *kickcom.ChannelV1
	Client      Client
	ChatHandler *ChatHandler
	SaveCfgFn   func(Config) error
}

func New

func New(
	ctx context.Context,
	cfg Config,
	saveCfgFn func(Config) error,
) (*Kick, error)

func (*Kick) ApplyProfile

func (k *Kick) ApplyProfile(ctx context.Context, profile StreamProfile, customArgs ...any) error

func (*Kick) BanUser

func (k *Kick) BanUser(
	ctx context.Context,
	userID streamcontrol.ChatUserID,
	reason string,
	deadline time.Time,
) error

func (*Kick) Close

func (k *Kick) Close() error

func (*Kick) EndStream

func (k *Kick) EndStream(ctx context.Context) error

func (*Kick) Flush

func (k *Kick) Flush(ctx context.Context) error

func (*Kick) GetChatMessagesChan

func (k *Kick) GetChatMessagesChan(
	ctx context.Context,
) (<-chan streamcontrol.ChatMessage, error)

func (*Kick) GetStreamStatus

func (k *Kick) GetStreamStatus(ctx context.Context) (*streamcontrol.StreamStatus, error)

func (*Kick) InsertAdsCuePoint

func (k *Kick) InsertAdsCuePoint(ctx context.Context, ts time.Time, duration time.Duration) error

func (*Kick) IsCapable

func (k *Kick) IsCapable(
	ctx context.Context,
	cap streamcontrol.Capability,
) bool

func (*Kick) RemoveChatMessage

func (k *Kick) RemoveChatMessage(ctx context.Context, messageID streamcontrol.ChatMessageID) error

func (*Kick) SendChatMessage

func (k *Kick) SendChatMessage(ctx context.Context, message string) error

func (*Kick) SetDescription

func (k *Kick) SetDescription(ctx context.Context, description string) error

func (*Kick) SetTitle

func (k *Kick) SetTitle(ctx context.Context, title string) error

func (*Kick) StartStream

func (k *Kick) StartStream(
	ctx context.Context,
	title string,
	description string,
	profile StreamProfile,
	customArgs ...any,
) error

type LivestreamInfoClient

type LivestreamInfoClient interface {
	GetLivestreamV2(
		ctx context.Context,
		channelSlug string,
	) (*kickcom.LivestreamV2Reply, error)
}

type OAuthHandler

type OAuthHandler = kick.OAuthHandler

type PlatformSpecificConfig

type PlatformSpecificConfig = kick.PlatformSpecificConfig

type StreamProfile

type StreamProfile = kick.StreamProfile

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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