Help us shape the future of Go! Take the 2026 Go Developer Survey

ptrrecords

package
v0.2.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateOpts

type CreateOpts struct {
	// Name of the ptr.
	PtrName string `json:"ptrdname" required:"true"`

	// Description of the ptr.
	Description string `json:"description,omitempty"`

	// TTL is the time to live of the ptr.
	TTL int `json:"-"`

	// Tags of the ptr.
	Tags []Tag `json:"tags,omitempty"`
}

CreateOpts specifies the attributes used to create a ptr.

func (CreateOpts) ToPtrCreateMap

func (opts CreateOpts) ToPtrCreateMap() (map[string]interface{}, error)

ToPtrCreateMap formats an CreateOpts structure into a request body.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToPtrCreateMap() (map[string]interface{}, error)
}

CreateOptsBuilder allows extensions to add additional attributes to the Create request.

type CreateResult

type CreateResult struct {
	// contains filtered or unexported fields
}

CreateResult is the result of a Create request. Call its Extract method to interpret the result as a Ptr.

func Create

func Create(client *golangsdk.ServiceClient, region string, fip_id string, opts CreateOptsBuilder) (r CreateResult)

Create implements a ptr create/update request.

func (CreateResult) Extract

func (r CreateResult) Extract() (*Ptr, error)

Extract interprets a GetResult, CreateResult as a Ptr. An error is returned if the original call or the extraction failed.

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

DeleteResult is the result of a Delete request. Call its ExtractErr method to determine if the request succeeded or failed.

func Delete

func Delete(client *golangsdk.ServiceClient, id string) (r DeleteResult)

Delete implements a ptr delete request.

type GetResult

type GetResult struct {
	// contains filtered or unexported fields
}

GetResult is the result of a Get request. Call its Extract method to interpret the result as a Ptr.

func Get

func Get(client *golangsdk.ServiceClient, id string) (r GetResult)

Get returns information about a ptr, given its ID.

func (GetResult) Extract

func (r GetResult) Extract() (*Ptr, error)

Extract interprets a GetResult, CreateResult as a Ptr. An error is returned if the original call or the extraction failed.

type Ptr

type Ptr struct {
	// ID uniquely identifies this ptr amongst all other ptr records.
	ID string `json:"id"`

	// Name for this ptr.
	PtrName string `json:"ptrdname"`

	// Description for this ptr.
	Description string `json:"description"`

	// TTL is the Time to Live for the ptr.
	TTL int `json:"ttl"`

	// Address of the floating ip.
	Address string `json:"address"`

	// Status of the PTR.
	Status string `json:"status"`
}

Ptr represents a ptr record.

type Tag

type Tag struct {
	// tag key
	Key string `json:"key" required:"true"`
	// tag value
	Value string `json:"value" required:"true"`
}

Tag is a structure of key value pair.

Jump to

Keyboard shortcuts

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