installations

package
v0.0.80 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package installations contains logic relating to GitHub provider installations

Index

Constants

View Source
const (
	// InstallationEventKey is the key for the event in the message metadata (e.g. removed)
	InstallationEventKey = "event"
	// ClassKey is the key for the provider class in the message metadata
	ClassKey = "class"
)
View Source
const (
	// ProviderInstallationTopic is the topic for when a provider installation is removed
	ProviderInstallationTopic = "internal.provider.installation.removed.event"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type InstallationInfoWrapper

type InstallationInfoWrapper struct {
	ProviderClass db.ProviderClass
	Payload       []byte
}

InstallationInfoWrapper is a helper struct to gether information about installations from events. It's able to build a message.Message from the information it gathers.

func NewInstallationInfoWrapper

func NewInstallationInfoWrapper() *InstallationInfoWrapper

NewInstallationInfoWrapper returns an empty *InstallationInfoWrapper for the caller to populate.

func (*InstallationInfoWrapper) ToMessage

func (iiw *InstallationInfoWrapper) ToMessage(msg *message.Message) error

ToMessage sets the information to a message.Message. It works via side effect.

func (*InstallationInfoWrapper) WithPayload

func (iiw *InstallationInfoWrapper) WithPayload(
	payload []byte,
) *InstallationInfoWrapper

WithPayload sets the payload for the installation.

It does not perform any sort of validation on the payload, i.e. it coud be empty byte array, empty string, or even an invalid json.

func (*InstallationInfoWrapper) WithProviderClass

func (iiw *InstallationInfoWrapper) WithProviderClass(
	class db.ProviderClass,
) *InstallationInfoWrapper

WithProviderClass sets the provider class for this Installation

type InstallationManager

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

InstallationManager is a struct representing the installation manager

func NewInstallationManager

func NewInstallationManager(
	svc service.GitHubProviderService,
) *InstallationManager

NewInstallationManager creates a new installation manager

func (*InstallationManager) Register

func (im *InstallationManager) Register(reg interfaces.Registrar)

Register implements the Consumer interface.

type ProviderInstallationEvent

type ProviderInstallationEvent string

ProviderInstallationEvent is an event that occurs when a provider installation changes

const (
	// ProviderInstanceRemovedEvent is an event that occurs when a provider instance is removed
	ProviderInstanceRemovedEvent ProviderInstallationEvent = "provider_instance_removed"
)

Jump to

Keyboard shortcuts

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