consul2route53

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2015 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Consulhost string
	Consulport string
	Zoneid     string
	Ttl        int64
}

Config represents the config settings for consul253

func ReadConfig

func ReadConfig(filename string) (Config, error)

ReadConfig reads a config yaml file on disk and returns config or error.

func (*Config) ConsulHost

func (c *Config) ConsulHost() string

func (*Config) ConsulPort

func (c *Config) ConsulPort() string

func (*Config) SetConsulHost

func (c *Config) SetConsulHost(consulhost string)

func (*Config) SetConsulPort

func (c *Config) SetConsulPort(consulport string)

func (*Config) SetTTL

func (c *Config) SetTTL(ttl int64)

func (*Config) SetZoneId

func (c *Config) SetZoneId(zoneid string)

func (*Config) TTL

func (c *Config) TTL() int64

func (*Config) ZoneId

func (c *Config) ZoneId() string

type Consul

type Consul struct {
	*Config
	// contains filtered or unexported fields
}

Consul represent information from a consul cluster

func (*Consul) GetNodes

func (c *Consul) GetNodes() error

GetNodes connects to a consul server and retrieves information about nodes. Returns error.

func (*Consul) GetServiceInfo

func (c *Consul) GetServiceInfo(servicename string) (*Service, error)

GetServiceInfo given a service name, connects to consul and retrieves information about that service. Returns *Service or error.

func (*Consul) GetServices

func (c *Consul) GetServices() error

GetServices connects to consul and gets a list of services. Returns error.

func (*Consul) Nodes

func (c *Consul) Nodes() []*Node

func (*Consul) Services

func (c *Consul) Services() []*Service

func (*Consul) ServicesMap

func (c *Consul) ServicesMap() map[string]*Service

type Consul2Route53

type Consul2Route53 struct {
	*Config
	*Consul
	*Route53Srv
}

func New

func New(c Config) *Consul2Route53

func (*Consul2Route53) Run

func (c *Consul2Route53) Run() error

type Json

type Json interface {
}

type Node

type Node struct {
	Node    string
	Address string
}

type Record

type Record struct {
	Type   string
	Name   string
	Value  string
	Weight int64
}

type Route53Srv

type Route53Srv struct {
	*Config

	Changes []*route53.Change
	// contains filtered or unexported fields
}

func (*Route53Srv) AddChange

func (r *Route53Srv) AddChange(changetype string, rec Record)

AddChange will handed "CHANGE","DELETE" or "UPSERT" and a pointer to a Record will add that change to Changes.

func (*Route53Srv) ChangeRecords

func (r *Route53Srv) ChangeRecords() error

ChangeRecords will execute a set of DNS changes in Route53, returns error.

func (*Route53Srv) ChangesNum

func (r *Route53Srv) ChangesNum() int

func (*Route53Srv) GetRecords

func (r *Route53Srv) GetRecords() error

GetRecords retrieves DNS records from Route53 and returns error.

func (*Route53Srv) GetZoneInfo

func (r *Route53Srv) GetZoneInfo() error

func (*Route53Srv) Records

func (r *Route53Srv) Records() []*Record

func (*Route53Srv) RecordsMap

func (r *Route53Srv) RecordsMap() (map[string]*Record, error)

func (*Route53Srv) SetSrv

func (r *Route53Srv) SetSrv(srvroute53 SrvRoute53)

func (*Route53Srv) SetZone

func (r *Route53Srv) SetZone(zone string)

func (*Route53Srv) Srv

func (r *Route53Srv) Srv() SrvRoute53

func (*Route53Srv) Zone

func (r *Route53Srv) Zone() string

type Service

type Service struct {
	ID      string
	Service string
	Tags    []string
	Port    int64
	Address string
}

type Srv

type Srv struct {
	Node           string
	Address        string
	ServiceID      string
	ServiceName    string
	ServiceTags    []string
	ServiceAddress string
	ServicePort    int64
}

Jump to

Keyboard shortcuts

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