console

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package console provides a source implementation to integrate with Mia Platform Console webhooks.

Index

Constants

View Source
const (
	MessageInvalidWebhookPath = "CONSOLE_WEBHOOK_PATH must start with '/'"
)

Variables

View Source
var (
	ErrSourceCreation       = errors.New("source creation error")
	ErrUnmarshalingEvent    = errors.New("error unmarshaling event")
	ErrEventChainProcessing = errors.New("error in event processing chain")
	ErrSignatureMismatch    = errors.New("webhook signature mismatch")
	ErrRetrievingAssets     = errors.New("error retrieving assets")
	ErrWebhookSecretMissing = errors.New("webhook secret not configured")
)
View Source
var (
	ErrWebhookConfigNotValid = errors.New("console source configuration not valid")
)

Functions

This section is empty.

Types

type Source

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

Source implements source.WebhookSource and source.SyncableSource for the Mia Platform Console. It can both poll all assets via the Console API and receive real-time mutations through a signed webhook.

func NewSource

func NewSource() (*Source, error)

NewSource constructs a Source by reading its configuration from environment variables and initialising the underlying Console API client. It returns ErrSourceCreation if either the webhook config or the API client cannot be created.

func (*Source) GetWebhook

func (s *Source) GetWebhook(ctx context.Context, typesToStream map[string]source.Extra, results chan<- source.Data) (source.Webhook, error)

GetWebhook returns a source.Webhook that validates incoming Console webhook requests against a shared secret and dispatches matching events to results asynchronously. It returns ErrWebhookSecretMissing when no secret is configured.

func (*Source) StartSyncProcess

func (s *Source) StartSyncProcess(ctx context.Context, typesToSync map[string]source.Extra, results chan<- source.Data) error

StartSyncProcess performs a full synchronisation of the requested resource types by listing all matching assets from the Console API and sending them to results. It blocks until every item has been written to the channel.

Directories

Path Synopsis
Package service provides the Console source service implementation.
Package service provides the Console source service implementation.

Jump to

Keyboard shortcuts

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