network

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: Apache-2.0 Imports: 4 Imported by: 21

Documentation

Index

Constants

View Source
const VIPActiveStatus = "Active"

VIPActiveStatus represents a VIP's status when active.

View Source
const VIPBucketPart = "BucketPart"

VIPBucketPart represents a VIP's status when termination is pending.

View Source
const VIPDisabledStatus = "Disabled"

VIPDisabledStatus represents a VIP's status when disabled.

View Source
const VIPNewStatus = "New"

VIPNewStatus represents a VIP's status when new.

View Source
const VIPPendingActivation = "Pending-Activation"

VIPPendingActivation represents a VIP's status when activation is pending.

View Source
const VIPPendingConfig = "Pending-Config"

VIPPendingConfig represents a VIP's status when configuration is pending.

View Source
const VIPPendingPayment = "Pending-Payment"

VIPPendingPayment represents a VIP's status when payment is pending.

View Source
const VIPPendingTermination = "Pending-Termination"

VIPPendingTermination represents a VIP's status when termination is pending.

View Source
const VIPTerminatedStatus = "Terminated"

VIPTerminatedStatus represents a VIP's status when terminated.

Variables

PendingStatuses is an array of strings representing the different statuses a VIP can be in before it is active.

Functions

This section is empty.

Types

type DNSBackend

type DNSBackend interface {
	Create(*DNSRecordParams) (*DNSRecord, error)
	Details(int) (*DNSRecord, error)
	List(*DNSRecordParams) (*DNSRecordList, error)
	ListAll(string) (DNSRecordList, error)
	Update(*DNSRecordParams) (*DNSRecord, error)
	Delete(*DNSRecordParams) (*DNSRecordDeletion, error)
}

DNSBackend describes the interface for interactions with the API.

type DNSClient

type DNSClient struct {
	Backend liquidweb.Backend
}

DNSClient is the backend implementation for interacting with DNS Records.

func (*DNSClient) Create

func (c *DNSClient) Create(params *DNSRecordParams) (*DNSRecord, error)

Create creates a new DNS Record.

func (*DNSClient) Delete

func (c *DNSClient) Delete(params *DNSRecordParams) (*DNSRecordDeletion, error)

Delete will delete a DNS Record.

func (*DNSClient) Details

func (c *DNSClient) Details(id int) (*DNSRecord, error)

Details returns details about a DNS Record.

func (*DNSClient) List

func (c *DNSClient) List(params *DNSRecordParams) (*DNSRecordList, error)

List returns a list of DNS Records.

func (*DNSClient) ListAll added in v1.6.4

func (c *DNSClient) ListAll(zone string) (result DNSRecordList, err error)

List returns a list of DNS Records.

func (*DNSClient) Update

func (c *DNSClient) Update(params *DNSRecordParams) (*DNSRecord, error)

Update will update a DNS Record.

type DNSRecord

type DNSRecord struct {
	ID              types.FlexInt    `json:"id,omitempty"`
	Name            string           `json:"name,omitempty"`
	Prio            types.FlexInt    `json:"prio,omitempty"`
	RData           string           `json:"rdata,omitempty"`
	TTL             types.FlexInt    `json:"ttl,omitempty"`
	Type            string           `json:"type,omitempty"`
	Zone            string           `json:"zone,omitempty"`
	ZoneID          types.FlexInt    `json:"zone_id,omitempty"`
	AdminEmail      string           `json:"adminEmail,omitempty"`
	Created         string           `json:"created,omitempty"`
	Exchange        string           `json:"exchange,omitempty"`
	Expiry          types.FlexInt    `json:"expiry,omitempty"`
	FullData        string           `json:"fullData,omitempty"`
	LastUpdated     string           `json:"last_updated,omitempty"`
	Minimum         types.FlexInt    `json:"minimum,omitempty"`
	Nameserver      string           `json:"nameserver,omitempty"`
	Port            types.FlexInt    `json:"port,omitempty"`
	RefreshInterval types.FlexInt    `json:"refreshInterval,omitempty"`
	RegionOverrides *RegionOverrides `json:"regionOverrides,omitempty"`
	Retry           types.FlexInt    `json:"retry,omitempty"`
	Serial          types.FlexInt    `json:"serial,omitempty"`
	Target          string           `json:"target,omitempty"`
	Weight          types.FlexInt    `json:"weight,omitempty"`
}

DNSRecord is the resource representing a DNS record entry.

type DNSRecordDeletion

type DNSRecordDeletion struct {
	Deleted types.FlexInt `json:"deleted"`
}

DNSRecordDeletion represents the API result when deleting a DNS Record.

type DNSRecordList

type DNSRecordList struct {
	liquidweb.ListMeta
	Items []DNSRecord `json:"items,omitempty"`
}

DNSRecordList is an envelope for the API result containing either a list of DNS Records or an error.

type DNSRecordParams

type DNSRecordParams struct {
	ID              int              `json:"id,omitempty"`
	Name            string           `json:"name,omitempty"`
	Prio            int              `json:"prio,omitempty"`
	RData           string           `json:"rdata,omitempty"`
	TTL             int              `json:"ttl,omitempty"`
	Type            string           `json:"type,omitempty"`
	Zone            string           `json:"zone,omitempty"`
	ZoneID          int              `json:"zone_id,omitempty"`
	AdminEmail      string           `json:"adminEmail,omitempty"`
	Created         string           `json:"created,omitempty"`
	Exchange        string           `json:"exchange,omitempty"`
	Expiry          int              `json:"expiry,omitempty"`
	FullData        string           `json:"fullData,omitempty"`
	LastUpdated     string           `json:"last_updated,omitempty"`
	Minimum         int              `json:"minimum,omitempty"`
	Nameserver      string           `json:"nameserver,omitempty"`
	Port            int              `json:"port,omitempty"`
	RefreshInterval int              `json:"refreshInterval,omitempty"`
	RegionOverrides *RegionOverrides `json:"regionOverrides,omitempty"`
	Retry           int              `json:"retry,omitempty"`
	Serial          int              `json:"serial,omitempty"`
	Target          string           `json:"target,omitempty"`
	Weight          int              `json:"weight,omitempty"`
	PageNum         int              `json:"page_num,omitempty"`
}

DNSRecordParams is the set of parameters used when creating or updating a DNS record.

type DNSZone added in v1.6.4

type DNSZone struct {
	ID                types.FlexInt  `json:"id,omitempty"`
	Name              string         `json:"name,omitempty"`
	Active            types.FlexInt  `json:"active,omitempty"`
	DelegationStatus  string         `json:"delegation_status,omitempty"`
	PrimaryNameserver string         `json:"master,omitempty"`
	NotifiedSerial    *types.FlexInt `json:"notified_serial,omitempty"`
	Contact           string         `json:"contact,omitempty"`
}

DNSRecord is the resource representing a DNS record entry.

type DNSZoneBackend added in v1.6.4

type DNSZoneBackend interface {
	List(liquidweb.ListMeta) (DNSZoneList, error)
	ListAll() (DNSZoneList, error)
	Create(DNSZoneCreateParams) (DNSZone, error)
	Details(string) (DNSZone, error)
	DeleteByName(string) error
}

type DNSZoneClient added in v1.6.4

type DNSZoneClient struct {
	Backend liquidweb.Backend
}

func (*DNSZoneClient) Create added in v1.6.4

func (c *DNSZoneClient) Create(params DNSZoneCreateParams) (result DNSZone, err error)

func (*DNSZoneClient) DeleteByName added in v1.6.4

func (c *DNSZoneClient) DeleteByName(zoneName string) (err error)

func (*DNSZoneClient) Details added in v1.6.4

func (c *DNSZoneClient) Details(zoneName string) (zone DNSZone, err error)

func (*DNSZoneClient) List added in v1.6.4

func (c *DNSZoneClient) List(params liquidweb.ListMeta) (result DNSZoneList, err error)

func (*DNSZoneClient) ListAll added in v1.6.4

func (c *DNSZoneClient) ListAll() (result DNSZoneList, err error)

type DNSZoneCreateParams added in v1.6.4

type DNSZoneCreateParams struct {
	Name                    string        `json:"name"`
	ImportRecords           types.FlexInt `json:"live_domain,omitempty"`
	SkipCreateCommonRecords types.FlexInt `json:"no_extra,omitempty"`
}

type DNSZoneList added in v1.6.4

type DNSZoneList struct {
	liquidweb.ListMeta
	Items []DNSZone `json:"items,omitempty"`
}

type LoadBalancer

type LoadBalancer struct {
	Name               string                 `json:"name,omitempty"`
	Nodes              []LoadBalancerNode     `json:"nodes,omitempty"`
	RegionID           types.FlexInt          `json:"region_id,omitempty"`
	Services           []LoadBalancerService  `json:"services,omitempty"`
	SessionPersistence types.NumericalBoolean `json:"session_persistence,omitempty"`
	SSLIncludes        types.NumericalBoolean `json:"ssl_includes,omitempty"`
	SSLTermination     types.NumericalBoolean `json:"ssl_termination,omitempty"`
	Strategy           string                 `json:"ip,omitempty"`
	UniqID             string                 `json:"uniq_id,omitempty"`
	VIP                types.IPAddr           `json:"vip,omitempty"`
}

LoadBalancer is the resource representing a load balancer.

type LoadBalancerBackend

type LoadBalancerBackend interface {
	Create(LoadBalancerParams) (*LoadBalancer, error)
	Details(string) (*LoadBalancer, error)
	Update(LoadBalancerParams) (*LoadBalancer, error)
	Delete(string) (*LoadBalancerDeletion, error)
}

LoadBalancerBackend describes the interface for interactions with the API.

type LoadBalancerClient

type LoadBalancerClient struct {
	Backend liquidweb.Backend
}

LoadBalancerClient is the backend implementation for interacting with the API.

func (*LoadBalancerClient) Create

Create creates a new load balancer.

func (*LoadBalancerClient) Delete

func (c *LoadBalancerClient) Delete(uniqID string) (*LoadBalancerDeletion, error)

Delete will delete a load balancer.

func (*LoadBalancerClient) Details

func (c *LoadBalancerClient) Details(uniqID string) (*LoadBalancer, error)

Details returns details about a load balancer.

func (*LoadBalancerClient) Update

Update will update a load balancer.

type LoadBalancerDeletion

type LoadBalancerDeletion struct {
	Destroyed string `json:"destroyed"`
}

LoadBalancerDeletion represents the API result when deleting a load balancer.

type LoadBalancerNode

type LoadBalancerNode struct {
	Domain string `json:"domain,omitempty"`
	IP     net.IP `json:"ip,omitempty"`
	UniqID string `json:"uniq_id,omitempty"`
}

LoadBalancerNode is the resource representing a load balancer node.

type LoadBalancerNodeParams

type LoadBalancerNodeParams struct {
	Domain string `json:"domain,omitempty"`
	IP     net.IP `json:"ip,omitempty"`
	UniqID string `json:"uniq_id,omitempty"`
}

LoadBalancerNodeParams is the resource representing a load balancer node.

type LoadBalancerParams

type LoadBalancerParams struct {
	UniqID             string                      `json:"uniq_id,omitempty"`
	Name               string                      `json:"name,omitempty"`
	Nodes              []string                    `json:"nodes,omitempty"`
	Region             int                         `json:"region,omitempty"`
	Services           []LoadBalancerServiceParams `json:"services,omitempty"`
	SessionPersistence bool                        `json:"session_persistence,omitempty"`
	SSLCert            string                      `json:"ssl_cert,omitempty"`
	SSLIncludes        bool                        `json:"ssl_includes,omitempty"`
	SSLInt             string                      `json:"ssl_int,omitempty"`
	SSLKey             string                      `json:"ssl_key,omitempty"`
	SSLTermination     bool                        `json:"ssl_termination,omitempty"`
	Strategy           string                      `json:"strategy,omitempty"`
}

LoadBalancerParams is the set of parameters used when creating or updating a load balancer.

type LoadBalancerService

type LoadBalancerService struct {
	UniqID   string        `json:"uniq_id,omitempty"`
	SrcPort  types.FlexInt `json:"src_port,omitempty"`
	DestPort types.FlexInt `json:"dest_port,omitempty"`
	Protocol string        `json:"protocol,omitempty"`
}

LoadBalancerService is the resource representing a load balancer service.

type LoadBalancerServiceParams

type LoadBalancerServiceParams struct {
	UniqID   string `json:"uniq_id,omitempty"`
	SrcPort  int    `json:"src_port,omitempty"`
	DestPort int    `json:"dest_port,omitempty"`
}

LoadBalancerServiceParams is the set of parameters used when adding services to a load balancer.

type RegionOverrides

type RegionOverrides struct {
	RData    string
	Region   string
	RegionID int
}

RegionOverrides contains region data.

type VIP

type VIP struct {
	Domain       string                 `json:"domain,omitempty"`
	Active       types.NumericalBoolean `json:"active,omitempty"`
	ActiveStatus string                 `json:"activeStatus,omitempty"`
	UniqID       string                 `json:"uniq_id,omitempty"`
	Destroyed    string                 `json:"destroyed,omitempty"`
	IP           string                 `json:"ip,omitempty"`
}

VIP is the resource representing a VIP entry.

type VIPBackend

type VIPBackend interface {
	Create(VIPParams) (*VIP, error)
	Destroy(string) (*VIPDeletion, error)
	Details(string) (*VIP, error)
}

VIPBackend describes the interface for interactions with the API.

type VIPClient

type VIPClient struct {
	Backend liquidweb.Backend
}

VIPClient is the backend implementation for interacting with VIP.

func (*VIPClient) Create

func (c *VIPClient) Create(params VIPParams) (*VIP, error)

Create creates a new VIP.

func (*VIPClient) Destroy

func (c *VIPClient) Destroy(uniqID string) (*VIPDeletion, error)

Destroy will delete a VIP.

func (*VIPClient) Details

func (c *VIPClient) Details(uniqID string) (*VIP, error)

Details returns details about a VIP.

type VIPDeletion

type VIPDeletion struct {
	Destroyed string `json:"destroyed"`
}

VIPDeletion represents the API result when deleting a VIP.

type VIPParams

type VIPParams struct {
	Domain     string `json:"domain,omitempty"`
	Zone       int    `json:"zone,omitempty"`
	UniqID     string `json:"uniq_id,omitempty"`
	SubAccount string `json:"subaccnt,omitempty"`
}

VIPParams is the set of parameters used when creating or updating a VIP.

type Zone

type Zone struct {
	ID             types.FlexInt                     `json:"id,omitempty"`
	IsDefault      types.NumericalBoolean            `json:"is_default,omitempty"`
	Name           string                            `json:"name,omitempty"`
	Region         ZoneRegion                        `json:"region,omitempty"`
	Status         string                            `json:"status,omitempty"`
	ValidSourceHVS map[string]types.NumericalBoolean `json:"valid_source_hvs,omitempty"`
}

Zone is a grouping of network resources.

type ZoneBackend

type ZoneBackend interface {
	Details(int) (*Zone, error)
	List(*ZoneListParams) (*ZoneList, error)
}

ZoneBackend is the interface for network zones.

type ZoneClient

type ZoneClient struct {
	Backend liquidweb.Backend
}

ZoneClient is the API client for network zones.

func (*ZoneClient) Details

func (c *ZoneClient) Details(id int) (*Zone, error)

Details fetches the details for a zone.

func (*ZoneClient) List

func (c *ZoneClient) List(params *ZoneListParams) (*ZoneList, error)

List returns a list of network zones.

type ZoneList

type ZoneList struct {
	liquidweb.ListMeta
	Items []Zone `json:"items,omitempty"`
}

ZoneList is an envelope for the API result containing either a list of zones or an error.

type ZoneListParams

type ZoneListParams struct {
	PageNum  int    `json:"page_num,omitempty"`
	PageSize int    `json:"page_size,omitempty"`
	Region   string `json:"region,omitempty"`
}

ZoneListParams are the set of parameters you can pass to the API for listing Network Zones.

type ZoneParams

type ZoneParams struct {
	ID int `json:"id,omitempty"`
}

ZoneParams are the set of parameters you can pass to the API for Network Zones.

type ZoneRegion

type ZoneRegion struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

ZoneRegion describes the zone the resources should be in.

Jump to

Keyboard shortcuts

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