Documentation
¶
Index ¶
- func CreateDevices() error
- func DHCPClient(ifname string) (*dhclient.Client, error)
- func ErrInvalidCfgFile(cfgFile string) error
- func ErrNotExists(fieldName string) error
- func Gettys(ctx context.Context, n int, persist bool)
- func InterfaceUp(ifname string) error
- func Mkdev(major, minor int) int
- func Mknod(path string, mode uint32, dev int) error
- func NewSSHServer(bind, keys string, opts ...option) (*server, error)
- func ParseServiceConfigs(dir string) (map[ServiceType][]*Service, error)
- func ScanDevices(ctx context.Context) error
- func SetupNetworkInterfaces() error
- func StartSSHServer(ctx context.Context)
- func StartServices(services map[ServiceType][]*Service)
- func WatchDevices(ctx context.Context) error
- func WithHostKeyFile(fn string) option
- type Command
- type Config
- type MountOption
- type Service
- type ServiceName
- type ServiceType
- type Unmounter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDevices ¶
func CreateDevices() error
func DHCPClient ¶
func ErrInvalidCfgFile ¶
func ErrNotExists ¶
func Gettys ¶
Gettys spawn the n number of getty processes on tty(s) If persist is true, they'll be respawned if they die.
func InterfaceUp ¶
func Mkdev ¶
Mkdev is used to build the value of linux devices (in /dev/) which specifies major and minor number of the newly created device special file. Linux device nodes are a bit weird due to backwards compat with 16 bit device nodes. They are, from low to high: the lower 8 bits of the minor, then 12 bits of the major, then the top 12 bits of the minor.
func Mknod ¶
Mknod creates a filesystem node (file, device special file or named pipe) named path with attributes specified by mode and dev.
func NewSSHServer ¶
func ParseServiceConfigs ¶
func ParseServiceConfigs(dir string) (map[ServiceType][]*Service, error)
Parses all the config in directory dir return a map of providers of ServiceTypes from that directory.
func ScanDevices ¶
ScanDevices scans /sys for devices and populate /dev
func SetupNetworkInterfaces ¶
func SetupNetworkInterfaces() error
func StartSSHServer ¶
func StartServices ¶
func StartServices(services map[ServiceType][]*Service)
func WatchDevices ¶
WatchDevices watches /sys for devices and populates /dev
func WithHostKeyFile ¶
func WithHostKeyFile(fn string) option
Types ¶
type Config ¶
func (*Config) WriteString ¶
type MountOption ¶
type Service ¶
type Service struct { Name ServiceName Startup Command Shutdown Command Provides []ServiceType Needs []ServiceType // contains filtered or unexported fields }
func ParseConfig ¶
Parses a single config file into the services it provides
func (Service) NeedsSatisfied ¶
Checks if all of s's needs are satified by the passed list of provided types
type ServiceName ¶
type ServiceName string
type ServiceType ¶
type ServiceType string