daemon

package
v0.0.0-...-b88123c Latest Latest
Warning

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

Go to latest
Published: May 1, 2023 License: Unlicense Imports: 32 Imported by: 0

Documentation

Overview

Package daemon provides the implementation of the Steady host daemon. The Daemon handles receiving application http requests, backing up sqlite databases, and managing the lifecycle of an application while it is on a host.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is an http client that is used to communicate with host daemons.

func NewClient

func NewClient(serverURL string, httpClient *http.Client) *Client

func (Client) CreateApplication

func (c Client) CreateApplication(ctx context.Context, req *daemonrpc.CreateApplicationRequest) (
	*daemonrpc.Application, error)

func (Client) DeleteApplication

func (c Client) DeleteApplication(ctx context.Context, req *daemonrpc.DeleteApplicationRequest) (
	*daemonrpc.Application, error)

func (Client) GetApplication

type Daemon

type Daemon struct {
	// contains filtered or unexported fields
}

Daemon is the steady daemon. It runs an http server, handles requests to create and delete applications, and handles database backups and migrations.

func NewDaemon

func NewDaemon(dataDirectory string, addr string, opts ...DaemonOption) *Daemon

func (*Daemon) ServerAddr

func (d *Daemon) ServerAddr() string

ServerAddr returns the address of the running server. Will panic if the server hasn't been started yet.

func (*Daemon) Start

func (d *Daemon) Start(ctx context.Context) error

Start starts the server.

func (*Daemon) StopAllApplications

func (d *Daemon) StopAllApplications()

StopAllApplications will loop through all applications and shut them down. Useful for tests where we would otherwise wait for applications to shut down normally.

func (*Daemon) Wait

func (d *Daemon) Wait() error

Wait for the server to exit, returning any errors.

type DaemonOption

type DaemonOption func(*Daemon)

func DaemonOptionWithS3

func DaemonOptionWithS3(cfg S3Config) DaemonOption

type S3Config

type S3Config struct {
	AccessKeyID     string
	SecretAccessKey string
	Bucket          string
	Path            string
	Endpoint        string
	SkipVerify      bool
	ForcePathStyle  bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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