projmanager

package
v9.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package projmanager contains functionality to execute commands (such as creating, updating, or deleting) entities (such as environments and filters) based on inspection of the entity's project key.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoConfigActions

type AutoConfigActions interface {
	EnvironmentActions
	ReceivedAllEnvironments()
	EnvironmentRefused(id config.EnvironmentID, reason string)
	SetRefusedEnvironments(refused map[config.EnvironmentID]string)
	ClearEnvironmentRefusal(id config.EnvironmentID)
}

AutoConfigActions represents all possible concrete actions that may occur based on autoconfig messages.

type EnvironmentActions

type EnvironmentActions interface {
	AddEnvironment(params envfactory.EnvironmentParams)
	UpdateEnvironment(params envfactory.EnvironmentParams)
	DeleteEnvironment(id config.EnvironmentID)
}

type EnvironmentManager

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

An EnvironmentManager manages the opening, modification, and closing of connections to LaunchDarkly environments for a particular LaunchDarkly project.

One EnvironmentManager is instantiated per project, and it manages that project's environments.

func NewEnvironmentManager

func NewEnvironmentManager(project string, handler EnvironmentActions, logger *slog.Logger) *EnvironmentManager

func (*EnvironmentManager) AddEnvironment

func (e *EnvironmentManager) AddEnvironment(env envfactory.EnvironmentParams)

func (*EnvironmentManager) DeleteEnvironment

func (e *EnvironmentManager) DeleteEnvironment(id config.EnvironmentID) bool

func (*EnvironmentManager) Environments

func (e *EnvironmentManager) Environments() []config.EnvironmentID

func (*EnvironmentManager) UpdateEnvironment

func (e *EnvironmentManager) UpdateEnvironment(env envfactory.EnvironmentParams)

type ProjectRouter

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

ProjectRouter is responsible for accepting commands relating to the creation, destruction, or modification of environments and filters, and then forwarding them to a ProjectManager based on the environment/filter's project key.

func NewProjectRouter

func NewProjectRouter(handler AutoConfigActions, logger *slog.Logger) *ProjectRouter

NewProjectRouter creates a new router which is ready to accept commands.

func (*ProjectRouter) AddEnvironment

func (e *ProjectRouter) AddEnvironment(params envfactory.EnvironmentParams)

AddEnvironment routes the given EnvironmentParams to the relevant ProjectManager based on its project key, or instantiates a new ProjectManager if one doesn't already exist.

func (*ProjectRouter) ClearEnvironmentRefusal

func (e *ProjectRouter) ClearEnvironmentRefusal(id config.EnvironmentID)

ClearEnvironmentRefusal forwards the retirement of a refusal. Like EnvironmentRefused it is not routed by project, because a refused environment has no manager to route it to.

func (*ProjectRouter) DeleteEnvironment

func (e *ProjectRouter) DeleteEnvironment(id config.EnvironmentID)

DeleteEnvironment dispatches a deletion command for the given environment ID to all ProjectManagers. It is assumed that environment IDs are unique, and therefore only one manager will service the request.

func (*ProjectRouter) EnvironmentRefused

func (e *ProjectRouter) EnvironmentRefused(id config.EnvironmentID, reason string)

EnvironmentRefused forwards a refusal. It is not routed by project: a refused environment was never created, so there is no manager to route it to, and its project key came from the payload this code has just declined to trust.

func (*ProjectRouter) Manager

func (e *ProjectRouter) Manager(projKey string) *EnvironmentManager

func (*ProjectRouter) Projects

func (e *ProjectRouter) Projects() []string

func (*ProjectRouter) ReceivedAllEnvironments

func (e *ProjectRouter) ReceivedAllEnvironments()

ReceivedAllEnvironments directly invokes the underlying AutoConfigAction's ReceivedAllEnvironments method.

func (*ProjectRouter) SetRefusedEnvironments

func (e *ProjectRouter) SetRefusedEnvironments(refused map[config.EnvironmentID]string)

SetRefusedEnvironments forwards the authoritative refusal set from a put. See EnvironmentRefused.

func (*ProjectRouter) UpdateEnvironment

func (e *ProjectRouter) UpdateEnvironment(params envfactory.EnvironmentParams)

UpdateEnvironment routes the given EnvironmentParams to the relevant ProjectManager based on its project key. If no such manager exists, the params are ignored and an error is logged.

Jump to

Keyboard shortcuts

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