Documentation ¶
Overview ¶
Package apps contains all logic for interacting with apps inside of a devenv. This entails discovering the versions of currently installed applications and adding a new application. This does NOT contain deployapp functionality which is currently in pkg/app instead.
Registry provides tools for working with development docker registries
Index ¶
- Variables
- func DevImageRegistry(ctx context.Context, log logrus.FieldLogger, b *box.Config, devenvName string) (string, error)
- type App
- type InMemoryClient
- func (i *InMemoryClient) Delete(_ context.Context, name string) error
- func (i *InMemoryClient) Get(_ context.Context, name string) (App, error)
- func (i *InMemoryClient) List(_ context.Context) ([]App, error)
- func (i *InMemoryClient) Reset(_ context.Context) error
- func (i *InMemoryClient) Set(_ context.Context, a *App) error
- type Interface
- type KubernetesConfigmapClient
- func (k *KubernetesConfigmapClient) Delete(ctx context.Context, name string) error
- func (k *KubernetesConfigmapClient) Get(ctx context.Context, name string) (App, error)
- func (k *KubernetesConfigmapClient) List(ctx context.Context) ([]App, error)
- func (k *KubernetesConfigmapClient) Reset(ctx context.Context) error
- func (k *KubernetesConfigmapClient) Set(ctx context.Context, a *App) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotFound denotes that an application was not found ErrNotFound = errors.New("Application not found") )
This block contains typed errors
Functions ¶
Types ¶
type App ¶
type App struct { // Name is the name of the application, this should be // 1:1 with the Github repository. Name string `json:"name" yaml:"name"` // Version is the currently deployed version of an application. // This should generally be semver and may be forced to be Version string `json:"version" yaml:"version"` // DeployedAt was when this app was deployed DeployedAt time.Time `json:"deployed_at" yaml:"deployedAt"` }
App is an application inside of a devenv
type InMemoryClient ¶
type InMemoryClient struct {
// contains filtered or unexported fields
}
InMemoryClient is an in memory client that implements the apps.Interface interface for usage in unit testing.
func NewInMemory ¶
func NewInMemory(defaultApps []App) *InMemoryClient
NewInMemory returns an apps.Interface satisfying client that uses an in memory store. Suitable for unit testing
func (*InMemoryClient) Delete ¶
func (i *InMemoryClient) Delete(_ context.Context, name string) error
Delete deletes an application
func (*InMemoryClient) List ¶
func (i *InMemoryClient) List(_ context.Context) ([]App, error)
List returns all known apps
type Interface ¶
type Interface interface { // List lists all known apps inside of a devenv List(ctx context.Context) ([]App, error) // Get returns information about an application if it exists in // a devenv. Get(ctx context.Context, name string) (App, error) // Set sets information about an application in the devenv Set(ctx context.Context, a *App) error // Delete deletes an application in the devenv Delete(ctx context.Context, name string) error // Reset deletes all application infomation and the underlying // datastore. Reset(ctx context.Context) error }
Interface is an interface for interacting with apps in a devenv
type KubernetesConfigmapClient ¶
type KubernetesConfigmapClient struct {
// contains filtered or unexported fields
}
KubernetesConfigmapClient is a Kubernetes backed client that implements the apps.Interface interface for storing information about apps.
func NewKubernetesConfigmapClient ¶
func NewKubernetesConfigmapClient(k kubernetes.Interface, namespace string) *KubernetesConfigmapClient
NewKubernetesConfigmapClient returns an initialized KubernetesConfigmapClient/ If namespace is not set it is defaulted to "devenv"
func (*KubernetesConfigmapClient) Delete ¶
func (k *KubernetesConfigmapClient) Delete(ctx context.Context, name string) error
Delete deletes an application, if it exists
func (*KubernetesConfigmapClient) List ¶
func (k *KubernetesConfigmapClient) List(ctx context.Context) ([]App, error)
List returns all known apps