server

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2017 License: BSD-2-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start()

Start fettle

Types

type Config

type Config struct {
	Fettle struct {
		Port    int    `default:"8099"`
		Address string `default:"0.0.0.0"`
	}

	Consul struct {
		Address string `default:"http://127.0.0.1:8500"`
		Health  struct {
			Interval   string `default:"10s"`
			Deregister string `default:"10m"`
			Address    string
		}
		Interval string `default:"30s"`
		Tags     []string
	}

	Service struct {
		Name    string `required:"true"`
		Address string `required:"true"`
	}

	Supervisor []struct {
		Name    string `required:"true"`
		Command string `required:"true"`
	}
}

Config holds fettle's configuration

type Instance

type Instance struct {
	ID                uuid.UUID
	Subprocesses      []Subprocess
	SubprocessChannel chan Subprocess
	Conf              *Config
}

Instance represents a fettle server

func NewInstance

func NewInstance() Instance

NewInstance creates a new Fettle instance

func (*Instance) ConsulURL

func (ins *Instance) ConsulURL() *url.URL

ConsulURL returns the URL for consul

func (*Instance) CreateCheckURL

func (ins *Instance) CreateCheckURL() string

CreateCheckURL create the health check url from the service id

func (*Instance) Register

func (ins *Instance) Register()

Register registers the service to consul

func (*Instance) RunServer added in v0.4.1

func (ins *Instance) RunServer() chan error

func (*Instance) RunSubprocess

func (ins *Instance) RunSubprocess(name string, command string)

RunSubprocess runs the give command and prints it's output to the stdout

func (*Instance) ServiceURL

func (ins *Instance) ServiceURL() *url.URL

ServiceURL returns the public URL for the servicv

type Subprocess

type Subprocess struct {
	Name    string
	Command string
	Error   error
}

Jump to

Keyboard shortcuts

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