server

package
Version: v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

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)
	// Delete a machine Group by id.
	GroupDelete(context.Context, *pb.GroupDeleteRequest) 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)
	// Delete a Profile by id.
	ProfileDelete(context.Context, *pb.ProfileDeleteRequest) 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(context.Context, *pb.IgnitionGetRequest) (string, error)
	// Delete an Ignition template by name.
	IgnitionDelete(context.Context, *pb.IgnitionDeleteRequest) error

	// Create or update an Generic template.
	GenericPut(context.Context, *pb.GenericPutRequest) (string, error)
	// Get an Generic template by name.
	GenericGet(context.Context, *pb.GenericGetRequest) (string, error)
	// Delete an Generic template by name.
	GenericDelete(context.Context, *pb.GenericDeleteRequest) error

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

Server defines the matchbox server interface.

func NewServer

func NewServer(config *Config) Server

NewServer returns a new Server.

Source Files

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