versioncontrol

package
v0.12.4 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Address  string `user:"true" help:"public address to listen on" default:":8080"`
	Versions ServiceVersions
}

Config is all the configuration parameters for a Version Control Server

type Peer

type Peer struct {
	// core dependencies
	Log *zap.Logger

	// Web server
	Server struct {
		Endpoint http.Server
		Listener net.Listener
	}
	Versions version.AllowedVersions
	// contains filtered or unexported fields
}

Peer is the representation of a VersionControl Server.

func New

func New(log *zap.Logger, config *Config) (peer *Peer, err error)

New creates a new VersionControl Server.

func (*Peer) Addr

func (peer *Peer) Addr() string

Addr returns the public address.

func (*Peer) Close

func (peer *Peer) Close() (err error)

Close closes all the resources.

func (*Peer) HandleGet

func (peer *Peer) HandleGet(w http.ResponseWriter, r *http.Request)

HandleGet contains the request handler for the version control web server

func (*Peer) Run

func (peer *Peer) Run(ctx context.Context) (err error)

Run runs versioncontrol server until it's either closed or it errors.

type ServiceVersions

type ServiceVersions struct {
	Bootstrap   string `user:"true" help:"Allowed Bootstrap Versions" default:"v0.0.1"`
	Satellite   string `user:"true" help:"Allowed Satellite Versions" default:"v0.0.1"`
	Storagenode string `user:"true" help:"Allowed Storagenode Versions" default:"v0.0.1"`
	Uplink      string `user:"true" help:"Allowed Uplink Versions" default:"v0.0.1"`
	Gateway     string `user:"true" help:"Allowed Gateway Versions" default:"v0.0.1"`
	Identity    string `user:"true" help:"Allowed Identity Versions" default:"v0.0.1"`
}

ServiceVersions provides a list of allowed Versions per Service

Jump to

Keyboard shortcuts

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