Documentation ¶
Index ¶
- Constants
- Variables
- func RefFloat64(value float64) *float64
- func RefInt(value int) *int
- func RefString(value string) *string
- func RefStringAsFloat64(value string) *float64
- func RefStringAsInt(value string) *int
- type BaseRecord
- type GitClient
- type GitHubClient
- func (g *GitHubClient) AddScope(name, path, branch, ext string) error
- func (g *GitHubClient) GetScope(name string) (scope Scope, err error)
- func (g *GitHubClient) GetZone(zone, scope string) (*Zone, error)
- func (g *GitHubClient) SaveZone(zone *Zone, comment string) error
- func (g *GitHubClient) SetAuthor(name, email string) error
- func (g *GitHubClient) SetBranch(branch string) error
- func (g *GitHubClient) SetScope(name, path, branch, ext string) error
- type OctodnsAzureDNS
- type OctodnsAzureDNSHealthcheck
- type OctodnsCloudflare
- type OctodnsRecordConfig
- type RType
- type Record
- func (r *Record) AddType(record Record) error
- func (r *Record) AddValueFromString(valueString string) error
- func (r *Record) ClearValues()
- func (r Record) MarshalYAML() (interface{}, error)
- func (r *Record) UnmarshalYAML(value *yaml.Node) error
- func (r *Record) UpdateYaml() error
- func (r *Record) ValuesAsString() []string
- type RecordValue
- func (r RecordValue) MarshalYAML() (interface{}, error)
- func (r *RecordValue) String() string
- func (r *RecordValue) StringCAA() string
- func (r *RecordValue) StringLOC() string
- func (r *RecordValue) StringMX() string
- func (r *RecordValue) StringNAPTR() string
- func (r *RecordValue) StringSRV() string
- func (r *RecordValue) StringSSHFP() string
- func (r *RecordValue) StringURLFWD() string
- func (r *RecordValue) UnmarshalString(value string) error
- func (r *RecordValue) UnmarshalStringA(value string) error
- func (r *RecordValue) UnmarshalStringAAAA(value string) error
- func (r *RecordValue) UnmarshalStringCAA(value string) error
- func (r *RecordValue) UnmarshalStringFQDN(value string) error
- func (r *RecordValue) UnmarshalStringLOC(value string) error
- func (r *RecordValue) UnmarshalStringMX(value string) error
- func (r *RecordValue) UnmarshalStringNAPTR(value string) error
- func (r *RecordValue) UnmarshalStringNS(value string) error
- func (r *RecordValue) UnmarshalStringPTR(value string) error
- func (r *RecordValue) UnmarshalStringSPF(value string) error
- func (r *RecordValue) UnmarshalStringSRV(value string) error
- func (r *RecordValue) UnmarshalStringSSHFP(value string) error
- func (r *RecordValue) UnmarshalStringURLFWD(value string) error
- func (r *RecordValue) UnmarshalYAML(value *yaml.Node) error
- type Scope
- type Subdomain
- func (r *Subdomain) CreateType(rtype string) (record *Record, err error)
- func (r *Subdomain) DeleteType(rtype string) (err error)
- func (r *Subdomain) FindAllType() error
- func (r *Subdomain) GetType(rtype string) (record *Record, err error)
- func (r *Subdomain) SetYaml(key, content *yaml.Node)
- func (r *Subdomain) UpdateYaml() (err error)
- type Terraform
- type Zone
- func (z *Zone) Close() int
- func (z *Zone) CreateSubdomain(subdomain string) (sub Subdomain, err error)
- func (z *Zone) DeleteSubdomain(subdomain string) (err error)
- func (z *Zone) FindRecordByType(subdomain string, rtype string) (rrecord *yaml.Node, rcontent *yaml.Node, rparent *yaml.Node, err error)
- func (z *Zone) FindSubdomain(subdomain string) (record Subdomain, err error)
- func (z *Zone) GetRecord(subdomain string, rtype string) (record *Record, err error)
- func (z *Zone) Open() int
- func (z *Zone) ReadYaml(content []byte) error
- func (z *Zone) ReadYamlFile(filename string) error
- func (z Zone) WriteYaml() ([]byte, error)
- func (z Zone) WriteYamlToFile(filename string) error
Constants ¶
View Source
const ( DEFAULT_SCOPE = "default" DEFAULT_PATH = "" DEFAULT_EXTENSION = "yaml" )
Variables ¶
View Source
var ( SubdomainNotFoundError = errors.New("subdomain not found in zone") SubdomainAlreadyExistsError = errors.New("subdomain already exists in zone") TypeNotFoundError = errors.New("record type not found in subdomain") TypeAlreadyExistsError = errors.New("record type already exists in subdomain") ValidateNotAnIP = errors.New("value not validated as an IP") ValidateNotAnIPV4 = errors.New("value not validated as an IPV4") ValidateNotAnIPV6 = errors.New("value not validated as an IPV6") ValidateIPNotAllowed = errors.New("an IP value is not allowed") ValidateFQDNRequiredTrailingDot = errors.New("fqdn value must end with a dot") ValidateFQDNForbidTrailingDot = errors.New("fqdn value may not end with a dot") ValidateNotAFQDN = errors.New("value not validated as a fqdn") )
Functions ¶
func RefFloat64 ¶ added in v0.1.0
func RefStringAsFloat64 ¶ added in v0.1.0
func RefStringAsInt ¶ added in v0.1.0
Types ¶
type BaseRecord ¶
type BaseRecord struct { RecordChild *yaml.Node `yaml:"-"` RecordNode *yaml.Node `yaml:"-"` RecordParent *yaml.Node `yaml:"-"` IsDeleted bool `yaml:"-"` Name string Type string Values []RecordValue `yaml:"values" line_comment:"Enable or disable."` TTL int Terraform Terraform Octodns OctodnsRecordConfig }
type GitClient ¶
type GitClient interface { AddScope(name, path, branch, ext string) error SetScope(name, path, branch, ext string) error GetZone(zone, scope string) (*Zone, error) SetBranch(branch string) error SetAuthor(name, email string) error }
func NewGitHubClient ¶
type GitHubClient ¶
type GitHubClient struct { *github.Client Owner string Repo string Scopes map[string]Scope Counter int Zones map[string]*Zone Mutex sync.RWMutex Branch string AuthorName string AuthorEmail string }
func (*GitHubClient) AddScope ¶
func (g *GitHubClient) AddScope(name, path, branch, ext string) error
func (*GitHubClient) GetScope ¶
func (g *GitHubClient) GetScope(name string) (scope Scope, err error)
func (*GitHubClient) SetAuthor ¶
func (g *GitHubClient) SetAuthor(name, email string) error
func (*GitHubClient) SetBranch ¶
func (g *GitHubClient) SetBranch(branch string) error
func (*GitHubClient) SetScope ¶
func (g *GitHubClient) SetScope(name, path, branch, ext string) error
type OctodnsAzureDNS ¶
type OctodnsAzureDNS struct {
Healthcheck OctodnsAzureDNSHealthcheck `yaml:",omitempty"`
}
type OctodnsCloudflare ¶
type OctodnsRecordConfig ¶
type OctodnsRecordConfig struct { Cloudflare *OctodnsCloudflare `yaml:",omitempty"` AzureDNS *OctodnsAzureDNS `yaml:",omitempty"` }
type RType ¶
type RType struct {
// contains filtered or unexported fields
}
var ( TYPE_A RType = RType{/* contains filtered or unexported fields */} TYPE_AAAA RType = RType{/* contains filtered or unexported fields */} TYPE_CAA RType = RType{/* contains filtered or unexported fields */} TYPE_CNAME RType = RType{/* contains filtered or unexported fields */} TYPE_DNAME RType = RType{/* contains filtered or unexported fields */} TYPE_LOC RType = RType{/* contains filtered or unexported fields */} TYPE_MX RType = RType{/* contains filtered or unexported fields */} TYPE_NAPTR RType = RType{/* contains filtered or unexported fields */} TYPE_NS RType = RType{/* contains filtered or unexported fields */} TYPE_PTR RType = RType{/* contains filtered or unexported fields */} TYPE_SPF RType = RType{/* contains filtered or unexported fields */} TYPE_SRV RType = RType{/* contains filtered or unexported fields */} TYPE_SSHFP RType = RType{/* contains filtered or unexported fields */} TYPE_TXT RType = RType{/* contains filtered or unexported fields */} TYPE_URLFWD RType = RType{/* contains filtered or unexported fields */} TYPES = map[string]RType{ TYPE_A.String(): TYPE_A, TYPE_AAAA.String(): TYPE_AAAA, TYPE_CAA.String(): TYPE_CAA, TYPE_CNAME.String(): TYPE_CNAME, TYPE_DNAME.String(): TYPE_DNAME, TYPE_LOC.String(): TYPE_LOC, TYPE_MX.String(): TYPE_MX, TYPE_NAPTR.String(): TYPE_NAPTR, TYPE_NS.String(): TYPE_NS, TYPE_PTR.String(): TYPE_PTR, TYPE_SPF.String(): TYPE_SPF, TYPE_SRV.String(): TYPE_SRV, TYPE_SSHFP.String(): TYPE_SSHFP, TYPE_TXT.String(): TYPE_TXT, TYPE_URLFWD.String(): TYPE_URLFWD, } )
func (RType) LowerString ¶
type Record ¶
type Record struct { BaseRecord Values []RecordValue `yaml:"values" line_comment:"Enable or disable."` }
func (*Record) AddValueFromString ¶
func (*Record) ClearValues ¶
func (r *Record) ClearValues()
func (Record) MarshalYAML ¶
func (*Record) UnmarshalYAML ¶
func (*Record) UpdateYaml ¶
func (*Record) ValuesAsString ¶
type RecordValue ¶
type RecordValue struct {
// contains filtered or unexported fields
}
func (RecordValue) MarshalYAML ¶
func (r RecordValue) MarshalYAML() (interface{}, error)
func (*RecordValue) String ¶
func (r *RecordValue) String() string
func (*RecordValue) StringCAA ¶ added in v0.1.0
func (r *RecordValue) StringCAA() string
func (*RecordValue) StringLOC ¶ added in v0.1.0
func (r *RecordValue) StringLOC() string
func (*RecordValue) StringMX ¶
func (r *RecordValue) StringMX() string
func (*RecordValue) StringNAPTR ¶ added in v0.1.0
func (r *RecordValue) StringNAPTR() string
func (*RecordValue) StringSRV ¶
func (r *RecordValue) StringSRV() string
func (*RecordValue) StringSSHFP ¶ added in v0.1.0
func (r *RecordValue) StringSSHFP() string
func (*RecordValue) StringURLFWD ¶ added in v0.1.0
func (r *RecordValue) StringURLFWD() string
func (*RecordValue) UnmarshalString ¶ added in v0.1.0
func (r *RecordValue) UnmarshalString(value string) error
func (*RecordValue) UnmarshalStringA ¶ added in v0.1.0
func (r *RecordValue) UnmarshalStringA(value string) error
func (*RecordValue) UnmarshalStringAAAA ¶ added in v0.1.0
func (r *RecordValue) UnmarshalStringAAAA(value string) error
func (*RecordValue) UnmarshalStringCAA ¶ added in v0.1.0
func (r *RecordValue) UnmarshalStringCAA(value string) error
func (*RecordValue) UnmarshalStringFQDN ¶ added in v0.1.0
func (r *RecordValue) UnmarshalStringFQDN(value string) error
func (*RecordValue) UnmarshalStringLOC ¶ added in v0.1.0
func (r *RecordValue) UnmarshalStringLOC(value string) error
func (*RecordValue) UnmarshalStringMX ¶ added in v0.1.0
func (r *RecordValue) UnmarshalStringMX(value string) error
func (*RecordValue) UnmarshalStringNAPTR ¶ added in v0.1.0
func (r *RecordValue) UnmarshalStringNAPTR(value string) error
func (*RecordValue) UnmarshalStringNS ¶ added in v0.1.0
func (r *RecordValue) UnmarshalStringNS(value string) error
func (*RecordValue) UnmarshalStringPTR ¶ added in v0.1.0
func (r *RecordValue) UnmarshalStringPTR(value string) error
func (*RecordValue) UnmarshalStringSPF ¶ added in v0.1.0
func (r *RecordValue) UnmarshalStringSPF(value string) error
func (*RecordValue) UnmarshalStringSRV ¶ added in v0.1.0
func (r *RecordValue) UnmarshalStringSRV(value string) error
func (*RecordValue) UnmarshalStringSSHFP ¶ added in v0.1.0
func (r *RecordValue) UnmarshalStringSSHFP(value string) error
func (*RecordValue) UnmarshalStringURLFWD ¶ added in v0.1.0
func (r *RecordValue) UnmarshalStringURLFWD(value string) error
func (*RecordValue) UnmarshalYAML ¶
func (r *RecordValue) UnmarshalYAML( value *yaml.Node, ) error
type Scope ¶
func (*Scope) CreateFilePath ¶
type Subdomain ¶
type Subdomain struct { Name string ContentNode *yaml.Node Types map[string]*Record // contains filtered or unexported fields }
func (*Subdomain) CreateType ¶
func (*Subdomain) DeleteType ¶
func (*Subdomain) FindAllType ¶
func (*Subdomain) UpdateYaml ¶
type Zone ¶
type Zone struct {
// contains filtered or unexported fields
}
func (*Zone) CreateSubdomain ¶
func (*Zone) DeleteSubdomain ¶
func (*Zone) FindRecordByType ¶
func (*Zone) FindSubdomain ¶
func (*Zone) ReadYamlFile ¶
func (Zone) WriteYamlToFile ¶
Click to show internal directories.
Click to hide internal directories.