model

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudflareConfig

type CloudflareConfig struct {
	APIKey string `validate:"required"`
	Email  string `validate:"required,email"`
}

CloudflareConfig is the data struct for the API configuration for Cloudflare

func (CloudflareConfig) Validate

func (c CloudflareConfig) Validate() error

Validate validates the contents of the CloudflareConfig struct

type CloudflareDNSRecord

type CloudflareDNSRecord struct {
	ID         string
	ZoneID     string `validate:"required"`
	Type       string `` /* 152-byte string literal not displayed */
	Name       string `validate:"required,max=255"`
	Content    string `validate:"required"`
	TTL        int    `validate:"required"`
	Priority   int
	Proxied    bool
	CreatedOn  time.Time
	ModifiedOn time.Time
}

CloudflareDNSRecord describes a Cloudflare DNS record

func (CloudflareDNSRecord) Validate

func (d CloudflareDNSRecord) Validate() error

Validate checks if the CloudflareDNSRecord struct is valid

type CloudflareZone

type CloudflareZone struct {
	ID         string
	Name       string
	Type       string
	Status     string
	CreatedOn  time.Time
	ModifiedOn time.Time
}

CloudflareZone describes a Cloudflare zone

func (*CloudflareZone) NormalizeDNSRecordName

func (z *CloudflareZone) NormalizeDNSRecordName(name string) string

NormalizeDNSRecordName joins a name with the name of the zone. Example: test will become test.example.com for z with Name example.com

type ConfigProfile

type ConfigProfile struct {
	Name   string `mapstructure:"-" toml:"-" validate:"required,lowercase,alphanum"`
	APIKey string `mapstructure:"api_key" toml:"api_key" validate:"required"`
	Email  string `mapstructure:"email" toml:"email" validate:"required,email"`
}

ConfigProfile is a single profile item in the config file

func (ConfigProfile) Validate

func (p ConfigProfile) Validate() error

Validate checks if the ConfigProfile struct is valid

type Model

type Model interface {
	Validate() error
}

Model is the base interface of the model package and should be implemented by all structs

Jump to

Keyboard shortcuts

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