Versions in this module Expand all Collapse all v0 v0.9.1 Nov 21, 2019 Changes in this version + var ErrorExtension = errors.New("extension must be either 'hcl' or 'json'") + func Write(w io.Writer, extension string, root *Root) error + func WriteFile(filename, format string, root *Root) (string, error) + func WriteHCL(w io.Writer, root *Root) error + func WriteJSON(w io.Writer, root *Root) error + type AliasService Service + type Association struct + ID string + Type string + type AssociationType int + const Contains + const Egress + const Ingress + func (i AssociationType) String() string + type Datacenter struct + Default bool + Description string + Name string + func (dc *Datacenter) FQDN() string + type Meta struct + Extra hcl.Body + Role string + Software string + Version string + type Resource struct + Associations []Association + Location string + Name string + Type string + func (r *Resource) FQDN() string + type ResourceType int + const ConsulClient + const ConsulCluster + const ConsulServer + const Firewall + const LoadBalancer + const ServicePool + func (i ResourceType) String() string + type Root struct + Datacenters []*Datacenter + Resources []*Resource + Services []*Service + func AddConsul(root *Root) (*Root, error) + func Parse(r io.Reader, filename, extension string) (*Root, error) + func ParseFile(filename string) (*Root, error) + func (r *Root) MarshalJSON() ([]byte, error) + type RootJSON struct + Datacenter map[string]*Datacenter + Resources map[string]map[string]*Resource + Services map[string]map[string]*Service + type Service struct + Address string + Meta []Meta + Name string + Port int + Protocol string + Type string + func (s *Service) MarshalJSON() ([]byte, error) + type ServiceJSON struct + Meta interface{} + type X struct