Documentation ¶
Overview ¶
Package server contains a full server for Pop to control and manage a Docker daemon. See cmd/docker-popd in the root of the project for a daemon executable.
Index ¶
Constants ¶
View Source
const (
// TokenBytes specifies how long a token is.
TokenBytes = 32
)
Variables ¶
View Source
var ( DefaultConfig = Config{ PopName: "docker-popd", Proto: pop.DefaultListenProtocol, Netaddr: pop.DefaultListenAddress, Users: Users{}, DockerdHost: client.DefaultDockerHost, LogLevel: log.DebugLevel, LogTimestamps: false, AutoRemove: true, } ErrMalformedAuthVar = errors.New("invalid POPD_AUTH variable (must be formatted like `user:pass,user2,pass2,[...]`)") )
DefaultConfig is a sane template config for a local server.
View Source
var ( ErrAddrTaken = grpc.Errorf(codes.AlreadyExists, "ip is not available") ErrIPExhausted = grpc.Errorf(codes.ResourceExhausted, "no more IP available for this network") ErrSubnetsExhausted = grpc.Errorf(codes.ResourceExhausted, "no more subnets available for this host") )
View Source
var ( ErrAlreadyStarted = grpc.Errorf(codes.AlreadyExists, "container already started") ErrAlreadyStopped = grpc.Errorf(codes.Unavailable, "container already stopped") ErrInvalidArgument = grpc.Errorf(codes.InvalidArgument, "invalid argument provided") ErrInvalidState = grpc.Errorf(codes.FailedPrecondition, "container is in an invalid state") ErrNoSuchContainer = grpc.Errorf(codes.NotFound, "no container for the given filter") ErrNoSuchFlavour = grpc.Errorf(codes.NotFound, "no flavour for the given filter") ErrNoSuchNetwork = grpc.Errorf(codes.NotFound, "no network for the given filter") ErrNotStarted = grpc.Errorf(codes.Unavailable, "container not started yet") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { PopName string Proto string Netaddr string Users Users DockerdHost string LogLevel log.Level LogTimestamps bool AutoRemove bool TLSCertPath string TLSKeyPath string }
Config for the PoP service.
func LoadConfig ¶
LoadConfig either reads a config file through viper, or it initialialises a new config bases on the DefaultConfig template, using the POPD_AUTH config variable to fill the authentication data. If neither of these options suits you, just fill a Config structure by yourself and create a Server instance using it.
type Server ¶
type Server struct { *log.Logger Config Config GRPCServer *grpc.Server // contains filtered or unexported fields }
Server represents the PoP service.
Click to show internal directories.
Click to hide internal directories.