core

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	DNS     DNS              // Register DNS name
	Ingress Ingress          // allow incoming HTTP(S) traffic to internal service
	Backup  Storage          // backup storage holder
	Network Network          // docker networking
	Docker  client.APIClient // docker api
}

Base environment for all instances.

type DNS

type DNS interface {
	// Register (updated or add) domains to current IP.
	Register(ctx context.Context, domains []string) error
}

DNS records management.

type Environment

type Environment struct {
	Base
	Name      string            // unique name of package/group
	Directory string            // working directory
	Vars      map[string]string // environment variables
	Event     Event             // event emitter
}

Environment context for single pipeline.

type Event

type Event interface {
	// Ready event
	Ready()
}

Event emitter.

type Ingress

type Ingress interface {
	// Clear routing table for the group.
	Clear(ctx context.Context, group string) error
	// Set (replaces) routing table for the group.
	Set(ctx context.Context, group string, domainAddresses map[string][]string) error
}

Ingress defines routing table for incoming traffic, where domain is unique reference to service. Real exposed domains could be different, as well as domain could be used in a different way (ie: routing by path).

type Network

type Network interface {
	// Join container to network or gather info. Should return assigned routable within network address (ip or hostname). Should not fail if container already linked.
	Join(ctx context.Context, containerID string) (address string, err error)
	// Leave network. Should not fail if container not exists or network already not connected.
	Leave(ctx context.Context, containerID string) error
	// Resolve address or address with port to routable (from application) endpoint (with port if needed).
	// Returned address may be different then after Join in case git-pipe is running as standalone application outside of docker.
	// It may work not properly in case container not running.
	Resolve(ctx context.Context, address string) (string, error)
	// ID of network in docker.
	ID() string
}

Network manager.

type Storage

type Storage interface {
	// Restore volumes from storage. Name usually equal to daemon name.
	Restore(ctx context.Context, name string, volumeNames []string) error
	// Backup volumes to storage.
	Backup(ctx context.Context, name string, volumeNames []string) error
	// Schedule regular backup. Backup interval defined by implementation.
	Schedule(ctx context.Context, name string, volumeNames []string) *internal.Task
}

Storage manager.

Directories

Path Synopsis
dns
cf

Jump to

Keyboard shortcuts

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