appconfig

package
v0.0.1-alpha.21 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package appconfig provides a basic emulation of AWS AppConfig.

Control plane implemented operations: CreateApplication, GetApplication, ListApplications, DeleteApplication, CreateEnvironment, GetEnvironment, ListEnvironments, DeleteEnvironment, CreateConfigurationProfile, GetConfigurationProfile, ListConfigurationProfiles, DeleteConfigurationProfile, CreateHostedConfigurationVersion, GetHostedConfigurationVersion, ListHostedConfigurationVersions, DeleteHostedConfigurationVersion.

Data-plane operations (StartConfigurationSession, GetLatestConfiguration) are implemented in the sibling appconfigdata package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	ID          string `json:"Id"`
	Name        string `json:"Name"`
	Description string `json:"Description,omitempty"`
}

Application represents an AppConfig application.

type ConfigurationProfile

type ConfigurationProfile struct {
	ApplicationId string `json:"ApplicationId"`
	ID            string `json:"Id"`
	Name          string `json:"Name"`
	LocationUri   string `json:"LocationUri,omitempty"`
	Type          string `json:"Type,omitempty"`
}

ConfigurationProfile represents an AppConfig configuration profile.

type Environment

type Environment struct {
	ApplicationId string `json:"ApplicationId"`
	ID            string `json:"Id"`
	Name          string `json:"Name"`
	Description   string `json:"Description,omitempty"`
	State         string `json:"State"`
}

Environment represents an AppConfig environment.

type HostedConfigurationVersion

type HostedConfigurationVersion struct {
	ApplicationId          string `json:"ApplicationId"`
	ConfigurationProfileId string `json:"ConfigurationProfileId"`
	VersionNumber          int    `json:"VersionNumber"`
	ContentType            string `json:"ContentType"`
	Description            string `json:"Description,omitempty"`
	Content                string `json:"Content"` // raw bytes stored as a string
}

HostedConfigurationVersion represents a stored configuration payload.

type Service

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

Service implements router.Service for AppConfig.

func New

func New(cfg *config.Config, st state.Store, logger *zap.Logger, _ clock.Clock) *Service

New returns a configured AppConfig Service.

func (*Service) Dispatch

func (s *Service) Dispatch(w http.ResponseWriter, r *http.Request)

func (*Service) GetHostedConfigVersionByNum

func (s *Service) GetHostedConfigVersionByNum(ctx context.Context, appID, profID string, version int) (*HostedConfigurationVersion, bool)

GetHostedConfigVersionByNum retrieves a specific hosted config version.

func (*Service) LatestVersionNumber

func (s *Service) LatestVersionNumber(ctx context.Context, appID, profID string) (int, error)

LatestVersionNumber returns the latest hosted config version number for a profile (0 = none).

func (*Service) Name

func (s *Service) Name() string

func (*Service) Operations

func (s *Service) Operations() []op.Operation

func (*Service) RegisterRoutes

func (s *Service) RegisterRoutes(r chi.Router)

RegisterRoutes registers the REST endpoints for AppConfig.

func (*Service) ResolveApplication

func (s *Service) ResolveApplication(ctx context.Context, identifier string) (*Application, bool)

ResolveApplication finds an application by ID or name. Returns (app, true) or (nil, false).

func (*Service) ResolveEnvironment

func (s *Service) ResolveEnvironment(ctx context.Context, appID, identifier string) (*Environment, bool)

ResolveEnvironment finds an environment by ID or name within the given app.

func (*Service) ResolveProfile

func (s *Service) ResolveProfile(ctx context.Context, appID, identifier string) (*ConfigurationProfile, bool)

ResolveProfile finds a configuration profile by ID or name within the given app.

func (*Service) SupportedProtocols

func (s *Service) SupportedProtocols() []codec.Codec

func (*Service) TargetPrefix

func (s *Service) TargetPrefix() string

Jump to

Keyboard shortcuts

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