conf

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2021 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Overview

Package conf manages Dryad's configuration.

Index

Constants

View Source
const DefaultRPCPort = 7175

DefaultRPCPort is a port that should be used as default parameter for Dryad's RPC client and server.

View Source
const DefaultSSHPort = 22

DefaultSSHPort is a default port off SSH daemon.

Variables

This section is empty.

Functions

This section is empty.

Types

type General

type General struct {
	// Address is used to listen for connection from Boruta.
	Address string `toml:"listen_address"`
	// BorutaAddress is used to connect to Boruta server.
	BorutaAddress string `toml:"boruta_address"`
	// SSHAdress is a ssh daemon listen address.
	SSHAdress string `toml:"ssh_address"`
	// Caps are necessary information to register in Boruta.
	//
	// TODO(amistewicz): This field should be removed when
	// it will be possible to read it from hardware.
	Caps boruta.Capabilities `toml:"caps"`
	// User refers information necessary to create the user.
	User *User `toml:"user"`
	// SDcard is a base path to block device of sdcard.
	SDcard string `toml:"sdcard"`
	// STMsocket is a path to the socket on which Go RPC service of stm.Interface is available.
	STMsocket string `toml:"stm_path"`
}

General is a base struct of configuration.

func NewConf

func NewConf() *General

NewConf returns a new instance of General configuration with default values set.

func (*General) Marshal

func (g *General) Marshal(w io.Writer) error

Marshal writes TOML representation of g to w.

func (*General) Unmarshal

func (g *General) Unmarshal(r io.Reader) error

Unmarshal reads TOML representation from r and parses it into g.

type User

type User struct {
	// Name is a username of a local account. It should be used to establish SSH session
	// to the system Dryad is running on.
	Name string `toml:"name"`
	// Groups is a list of local Unix groups the username belongs to.
	Groups []string `toml:"groups"`
}

User is a section in a configuration used for user manipulation.

Jump to

Keyboard shortcuts

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