Help us shape the future of Go! Take the 2026 Go Developer Survey

courier

package module
v0.0.0-...-9f9ffe7 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2018 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigSaveLocation = "courier/config.json"

ConfigSaveLocation the location to save the config to.

View Source
var DefaultConfig = Config{
	Data:              Data{},
	Repo:              "gogs@git.cory.red:DankBotList/Site.git",
	Ref:               "refs/heads/master",
	PollTimeSeconds:   20,
	WebSocketPath:     "/courier/ws",
	AuthenticationKey: uuid.Must(uuid.NewV4()).String() + "-" + uuid.Must(uuid.NewV4()).String(),
	DataFolder:        "courier/data/",
}

DefaultConfig the default configuration to save.

View Source
var DefaultConfigSavedError = errors.New("the default config has been saved, please edit it")

DefaultConfigSavedError an error returned if the default config is saved.

Functions

This section is empty.

Types

type Config

type Config struct {
	Data              `json:"-"`
	Repo              string `json:"repo"`
	Ref               string `json:"ref"`
	PollTimeSeconds   int    `json:"poll_time_seconds"`
	WebSocketPath     string `json:"web_socket_path"`
	AuthenticationKey string `json:"authentication_key"`
	DataFolder        string `json:"data_folder"`
}

Config the main configuration.

func (*Config) Load

func (c *Config) Load() error

Load loads the config.

func (*Config) Save

func (c *Config) Save() error

Save saves the config.

type Data

type Data struct{}

Data an abstract struct used for it's functions to save and load config files.

type Host

type Host struct {
}

========== Hosts.

type HostsData

type HostsData struct {
	Data     `json:"-"`
	DataFile string `json:"-"`
	Hosts    []Host `json:"hosts"`
}

HostsData the data for hosts, their locations and ID's.

func (*HostsData) Load

func (c *HostsData) Load() error

Load loads the config.

func (*HostsData) Save

func (c *HostsData) Save() error

Save saves the config.

func (*HostsData) SetDataFile

func (c *HostsData) SetDataFile(dataFile string)

type Instance

type Instance struct {
	InstanceID string
	// contains filtered or unexported fields
}

Instance an instance of a courier, locked by a file.

func New

func New(engine *gin.Engine) (i *Instance, err error)

New creates a new instance or throws errors.

func (*Instance) SetInstanceID

func (i *Instance) SetInstanceID(id string)

SetInstanceID sets the instance id to be used when communicating

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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