cmd

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: GPL-3.0 Imports: 48 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
var (
	Version string = "dev"
)

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

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) AddRecord added in v1.10.0

func (c *CloudflareProvider) AddRecord(ctx context.Context, zoneID string, record DnsRecord) error

func (*CloudflareProvider) DeleteRecord added in v1.10.0

func (c *CloudflareProvider) DeleteRecord(ctx context.Context, zoneID string, record DnsRecord) error

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 (c *CloudflareProvider) ListRecords(ctx context.Context, zoneID string) ([]DnsRecord, error)

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 (c *CloudflareProvider) ReplaceRecord(ctx context.Context, zoneID string, record DnsRecord) error

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 PathType added in v1.10.0

type PathType int
const (
	PathLocal PathType = iota
	PathS3
)

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) AddRecord added in v1.10.0

func (r *Route53Provider) AddRecord(ctx context.Context, zoneID string, record DnsRecord) error

func (*Route53Provider) DeleteRecord added in v1.10.0

func (r *Route53Provider) DeleteRecord(ctx context.Context, zoneID string, record DnsRecord) error

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 (r *Route53Provider) ListRecords(ctx context.Context, zoneID string) ([]DnsRecord, error)

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 (r *Route53Provider) ReplaceRecord(ctx context.Context, zoneID string, record DnsRecord) error

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

Jump to

Keyboard shortcuts

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