server

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2017 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Overview

Package server is a matchbox library package for implementing servers.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoMatchingGroup   = errors.New("matchbox: No matching Group")
	ErrNoMatchingProfile = errors.New("matchbox: No matching Profile")
)

Possible service errors

Functions

This section is empty.

Types

type Config

type Config struct {
	Store storage.Store
}

Config configures a server implementation.

type Server

type Server interface {
	// SelectGroup returns the Group matching the given labels.
	SelectGroup(context.Context, *pb.SelectGroupRequest) (*storagepb.Group, error)
	// SelectProfile returns the Profile matching the given labels.
	SelectProfile(context.Context, *pb.SelectProfileRequest) (*storagepb.Profile, error)

	// Create or update a Group.
	GroupPut(context.Context, *pb.GroupPutRequest) (*storagepb.Group, error)
	// Get a machine Group by id.
	GroupGet(context.Context, *pb.GroupGetRequest) (*storagepb.Group, error)
	// List all machine Groups.
	GroupList(context.Context, *pb.GroupListRequest) ([]*storagepb.Group, error)

	// Create or update a Profile.
	ProfilePut(context.Context, *pb.ProfilePutRequest) (*storagepb.Profile, error)
	// Get a Profile by id.
	ProfileGet(context.Context, *pb.ProfileGetRequest) (*storagepb.Profile, error)
	// List all Profiles.
	ProfileList(context.Context, *pb.ProfileListRequest) ([]*storagepb.Profile, error)

	// Create or update an Ignition template.
	IgnitionPut(context.Context, *pb.IgnitionPutRequest) (string, error)
	// Get an Ignition template by name.
	IgnitionGet(ctx context.Context, name string) (string, error)

	// Get a Cloud-Config template by name.
	CloudGet(ctx context.Context, name string) (string, error)

	// Get a generic template by name.
	GenericGet(ctc context.Context, name string) (string, error)
}

Server defines the matchbox server interface.

func NewServer

func NewServer(config *Config) Server

NewServer returns a new Server.

Directories

Path Synopsis
Package serverpb provides matchbox message types.
Package serverpb provides matchbox message types.

Jump to

Keyboard shortcuts

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