Documentation
¶
Overview ¶
Copyright © 2026 Jonathan Gao <gsmlg.com@gmail.com>
Copyright © 2022 Jonathan Gao <gsmlg.com@gmail.com>
Copyright © 2026 Jonathan Gao <gsmlg.com@gmail.com>
Copyright © 2022 Jonathan Gao <gsmlg.com@gmail.com>
Copyright © 2022 Jonathan Gao <gsmlg.com@gmail.com>
Copyright © 2022 Jonathan Gao <gsmlg.com@gmail.com>
Copyright © 2022 Jonathan Gao <gsmlg.com@gmail.com>
Copyright © 2022 Jonathan Gao <gsmlg.com@gmail.com>
Copyright © 2022 Jonathan Gao <gsmlg.com@gmail.com>
Copyright © 2024 Jonathan Gao <gsmlg.com@gmail.com>
Copyright © 2022 Jonathan Gao gsmlg.com@gmail.com
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright © 2022 Jonathan Gao <gsmlg.com@gmail.com>
Copyright © 2026 Jonathan Gao <gsmlg.com@gmail.com>
Copyright © 2022 Jonathan Gao <gsmlg.com@gmail.com>
Copyright © 2026 Jonathan Gao <gsmlg.com@gmail.com>
Index ¶
- Variables
- func Execute()
- type AliasConfig
- type CloudflareProvider
- func (c *CloudflareProvider) AddRecord(ctx context.Context, zoneID string, record DnsRecord) error
- func (c *CloudflareProvider) DeleteRecord(ctx context.Context, zoneID string, record DnsRecord) error
- func (c *CloudflareProvider) DeleteZone(ctx context.Context, id string) error
- func (c *CloudflareProvider) ListRecords(ctx context.Context, zoneID string) ([]DnsRecord, error)
- func (c *CloudflareProvider) ListZones(ctx context.Context) ([]DnsZone, error)
- func (c *CloudflareProvider) Name() string
- func (c *CloudflareProvider) ReplaceRecord(ctx context.Context, zoneID string, record DnsRecord) error
- func (c *CloudflareProvider) Type() string
- type DnsConfig
- type DnsProvider
- type DnsRecord
- type DnsZone
- type PathType
- type ProviderConfig
- type ResolvedPath
- type Route53Provider
- func (r *Route53Provider) AddRecord(ctx context.Context, zoneID string, record DnsRecord) error
- func (r *Route53Provider) DeleteRecord(ctx context.Context, zoneID string, record DnsRecord) error
- func (r *Route53Provider) DeleteZone(ctx context.Context, id string) error
- func (r *Route53Provider) ListRecords(ctx context.Context, zoneID string) ([]DnsRecord, error)
- func (r *Route53Provider) ListZones(ctx context.Context) ([]DnsZone, error)
- func (r *Route53Provider) Name() string
- func (r *Route53Provider) ReplaceRecord(ctx context.Context, zoneID string, record DnsRecord) error
- func (r *Route53Provider) Type() string
- type S3Config
Constants ¶
This section is empty.
Variables ¶
var (
Version string = "dev"
)
Functions ¶
Types ¶
type AliasConfig ¶ added in v1.10.0
type AliasConfig struct {
Name string `mapstructure:"name" yaml:"name" json:"name"`
Endpoint string `mapstructure:"endpoint" yaml:"endpoint" json:"endpoint"`
AccessKeyID string `mapstructure:"access_key_id" yaml:"access_key_id" json:"access_key_id"`
SecretAccessKey string `mapstructure:"secret_access_key" yaml:"secret_access_key" json:"secret_access_key"`
Region string `mapstructure:"region" yaml:"region" json:"region"`
}
AliasConfig represents configuration for an S3 alias
type CloudflareProvider ¶ added in v1.10.0
type CloudflareProvider struct {
// contains filtered or unexported fields
}
CloudflareProvider implements DnsProvider
func (*CloudflareProvider) DeleteRecord ¶ added in v1.10.0
func (*CloudflareProvider) DeleteZone ¶ added in v1.10.0
func (c *CloudflareProvider) DeleteZone(ctx context.Context, id string) error
func (*CloudflareProvider) ListRecords ¶ added in v1.10.0
func (*CloudflareProvider) ListZones ¶ added in v1.10.0
func (c *CloudflareProvider) ListZones(ctx context.Context) ([]DnsZone, error)
func (*CloudflareProvider) Name ¶ added in v1.10.0
func (c *CloudflareProvider) Name() string
func (*CloudflareProvider) ReplaceRecord ¶ added in v1.10.0
func (*CloudflareProvider) Type ¶ added in v1.10.0
func (c *CloudflareProvider) Type() string
type DnsConfig ¶ added in v1.10.0
type DnsConfig struct {
Providers []ProviderConfig `mapstructure:"providers"`
}
DnsConfig holds list of configured DNS providers
type DnsProvider ¶ added in v1.10.0
type DnsProvider interface {
Name() string
Type() string
ListZones(ctx context.Context) ([]DnsZone, error)
DeleteZone(ctx context.Context, id string) error
ListRecords(ctx context.Context, zoneID string) ([]DnsRecord, error)
AddRecord(ctx context.Context, zoneID string, record DnsRecord) error
ReplaceRecord(ctx context.Context, zoneID string, record DnsRecord) error
DeleteRecord(ctx context.Context, zoneID string, record DnsRecord) error
}
DnsProvider interface abstracts Cloudflare and Route53 DNS operations
type DnsRecord ¶ added in v1.10.0
type DnsRecord struct {
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
TTL int `json:"ttl"`
Value string `json:"content"`
Proxied string `json:"proxied"`
}
DnsRecord represents a generic DNS resource record
type DnsZone ¶ added in v1.10.0
type DnsZone struct {
Provider string `json:"provider"`
ID string `json:"id"`
Name string `json:"name"`
Status string `json:"status"`
RecordCount string `json:"record_count"`
}
DnsZone represents a generic DNS zone
type ProviderConfig ¶ added in v1.10.0
type ProviderConfig struct {
Name string `mapstructure:"name"`
Type string `mapstructure:"type"`
Token string `mapstructure:"token,omitempty"`
Email string `mapstructure:"email,omitempty"`
Key string `mapstructure:"key,omitempty"`
AccessKeyID string `mapstructure:"access_key_id,omitempty"`
SecretAccessKey string `mapstructure:"secret_access_key,omitempty"`
Region string `mapstructure:"region,omitempty"`
}
ProviderConfig represents configuration for a DNS provider
type ResolvedPath ¶ added in v1.10.0
type ResolvedPath struct {
Type PathType
Raw string
Alias AliasConfig
Bucket string
Key string
}
type Route53Provider ¶ added in v1.10.0
type Route53Provider struct {
// contains filtered or unexported fields
}
Route53Provider implements DnsProvider
func (*Route53Provider) DeleteRecord ¶ added in v1.10.0
func (*Route53Provider) DeleteZone ¶ added in v1.10.0
func (r *Route53Provider) DeleteZone(ctx context.Context, id string) error
func (*Route53Provider) ListRecords ¶ added in v1.10.0
func (*Route53Provider) ListZones ¶ added in v1.10.0
func (r *Route53Provider) ListZones(ctx context.Context) ([]DnsZone, error)
func (*Route53Provider) Name ¶ added in v1.10.0
func (r *Route53Provider) Name() string
func (*Route53Provider) ReplaceRecord ¶ added in v1.10.0
func (*Route53Provider) Type ¶ added in v1.10.0
func (r *Route53Provider) Type() string
type S3Config ¶ added in v1.10.0
type S3Config struct {
Aliases []AliasConfig `mapstructure:"aliases" yaml:"aliases"`
}
S3Config holds the list of configured S3 aliases