services

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

README

Services

Services will talk to each other. Actors within the bloopyboi domain will use services as the interaction layer. Each service may have a client to communicate with an external service like authentik, k8s, overseerr, etc.

Documentation

Index

Constants

View Source
const (
	ServiceLoggerFieldKey = "service_name"
	DefaultUUID           = ""
)

Variables

View Source
var (
	InspiroFeatureName  = "inspiro"
	InspiroAPIKey       = "api_url"
	InspiroBackupURLKey = "backup_image_link"
)

Functions

func GetTLSTransport

func GetTLSTransport(insecure bool) http.RoundTripper

GetTLSTransport Get a TLS transport instance, that skips verification if configured via environment variables.

Types

type AuthentikClientGenerator

type AuthentikClientGenerator struct {
	models.ClientGenerator
}

type AuthentikService

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

func NewAuthentikService

func NewAuthentikService(clientgen *AuthentikClientGenerator) *AuthentikService

func (*AuthentikService) GetClient

func (s *AuthentikService) GetClient() *api.APIClient

func (*AuthentikService) Verify

func (s *AuthentikService) Verify(ctx context.Context) bool

type BlissfestService

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

func NewBlissfestService

func NewBlissfestService(config pkgmodels.BlissfestConfig) *BlissfestService

func (*BlissfestService) GetEndTime

func (bs *BlissfestService) GetEndTime() *time.Time

func (*BlissfestService) GetLineupImageURI

func (bs *BlissfestService) GetLineupImageURI() string

func (*BlissfestService) GetStartTime

func (bs *BlissfestService) GetStartTime() *time.Time

func (*BlissfestService) GetTimeUntilEnd

func (bs *BlissfestService) GetTimeUntilEnd(fromDate *time.Time) time.Duration

Gets time until end of event

func (*BlissfestService) GetTimeUntilStart

func (bs *BlissfestService) GetTimeUntilStart(fromDate *time.Time) time.Duration

Gets time until start of event

func (*BlissfestService) IsInProgress

func (bs *BlissfestService) IsInProgress() bool

Returns true if event inProgress

type BookService

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

func NewBookService

func NewBookService(ctx context.Context, options ...option.ClientOption) *BookService

func (*BookService) GetVolume

func (b *BookService) GetVolume(volumeId string) (*books.Volume, error)

func (*BookService) SearchBook

func (b *BookService) SearchBook(ctx context.Context, req *models.BookSearchRequest) (*books.Volumes, error)

type BotK8sMeta

type BotK8sMeta struct {
}

type ConfigService

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

func NewConfigService

func NewConfigService(configLoader config.ConfigLoader) *ConfigService

func (*ConfigService) GetConfig

func (s *ConfigService) GetConfig() (*config.AppConfig, error)

type DiscordService added in v0.4.5

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

func NewDiscordService added in v0.4.5

func NewDiscordService(session *discordgo.Session) *DiscordService

func (*DiscordService) AddHandler added in v0.4.5

func (d *DiscordService) AddHandler(handler interface{}) func()

func (*DiscordService) AddInteractionHandlerProxy added in v0.4.7

func (d *DiscordService) AddInteractionHandlerProxy()

Proxies InteractionCreate events to the handlers in the svc handler registry

func (*DiscordService) DeleteAppCommands added in v0.4.7

func (d *DiscordService) DeleteAppCommands()

De-registers all app commands registered with this service. Intended for use by the shutdown handler.

func (*DiscordService) GetDataReady added in v0.4.5

func (d *DiscordService) GetDataReady() bool

func (*DiscordService) GetMeta added in v0.4.5

func (d *DiscordService) GetMeta() models.BloopyMeta

func (*DiscordService) GetSession added in v0.4.5

func (d *DiscordService) GetSession() *discordgo.Session

Primarily for backwards compatibility while I move things into a service

func (*DiscordService) RegisterAppCommand added in v0.4.7

func (d *DiscordService) RegisterAppCommand(command models.DiscordAppCommand) (*discordgo.ApplicationCommand, error)

Registers an app command with discord and adds the respective handler to the svc handler registry.

func (*DiscordService) RegisterMessageComponentHandlers added in v0.4.7

func (d *DiscordService) RegisterMessageComponentHandlers(additionalHandlers map[string]func(*discordgo.Session, *discordgo.InteractionCreate)) error

Adds additional handlers to the svc handler registry. Intended for use by MessageComponent handlers

type InspiroClient

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

should add uri validation

func NewInspiroClient added in v0.4.7

func NewInspiroClient() *InspiroClient

Abstracted 'Constructor'

func NewInspiroClientWithConfig added in v0.4.7

func NewInspiroClientWithConfig(myConfig InspiroConfig) *InspiroClient

'Constructs' InspiroClient with declared Config

func (*InspiroClient) GetInspiro added in v0.4.7

func (inspiroService *InspiroClient) GetInspiro() string

returns raw uri as string without validation

type InspiroConfig

type InspiroConfig struct {
	API_url           string
	Logger            *zap.Logger
	Backup_image_link string
}

Basically a static var for this 'Object'

func GetInspiroConfig

func GetInspiroConfig() InspiroConfig

Unmarshal config from file

type InspiroService

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

func NewInspiroHttpClient

func NewInspiroHttpClient(inspiro *InspiroClient) *InspiroService

Creates New InspiroService with specified Service

func (*InspiroService) CreateInsprioEmbed added in v0.4.7

func (ic *InspiroService) CreateInsprioEmbed() *discordgo.MessageEmbed

Creates the discord.Embed object to be used in a message

func (*InspiroService) CreateInteractionResponse added in v0.4.7

func (ic *InspiroService) CreateInteractionResponse() *discordgo.InteractionResponse

Creates InteractionResponse with default Type and Flags, etc.

func (*InspiroService) CreateInteractionResponseData added in v0.4.7

func (ic *InspiroService) CreateInteractionResponseData() *discordgo.InteractionResponseData

Creates InteractionResponseData with to be used with custom flags, etc

func (*InspiroService) GetClient added in v0.4.7

func (ic *InspiroService) GetClient() *InspiroClient

func (*InspiroService) GetInspiroImageURL added in v0.4.7

func (ic *InspiroService) GetInspiroImageURL() string

type K8sService

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

func NewK8sService

func NewK8sService() *K8sService

func (*K8sService) GetPodMetrics

func (ks *K8sService) GetPodMetrics(ctx context.Context) []v1beta1.PodMetrics

func (*K8sService) GetPodNamespace

func (ks *K8sService) GetPodNamespace(ctx context.Context) (string, error)

func (*K8sService) ListNamespaces

func (ks *K8sService) ListNamespaces(ctx context.Context) []coreV1.Namespace

type MediaService

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

func NewMediaService

func NewMediaService(overseerrGen *OverseerrClientGenerator, bookService *BookService) *MediaService

type OverseerrClientGenerator

type OverseerrClientGenerator struct {
	models.ClientGenerator
}

type OverseerrService

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

func NewOverseerrService

func NewOverseerrService(clientgen *OverseerrClientGenerator) *OverseerrService

Jump to

Keyboard shortcuts

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