dmapi

package
v4.13.2 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package dmapi Client for DMAPI joker.com. https://joker.com/faq/category/39/22-dmapi.html

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTxtEntryToZone

func AddTxtEntryToZone(zone, relative, value string, ttl int) string

AddTxtEntryToZone returns DNS zone with added TXT record.

func RemoveTxtEntryFromZone

func RemoveTxtEntryFromZone(zone, relative string) (string, bool)

RemoveTxtEntryFromZone clean-ups all TXT records with given name.

Types

type AuthInfo

type AuthInfo struct {
	APIKey   string
	Username string
	Password string
}

type Client

type Client struct {
	Debug      bool
	BaseURL    string
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

Client a DMAPI Client.

func NewClient

func NewClient(authInfo AuthInfo) *Client

NewClient creates a new DMAPI Client.

func (*Client) CreateAuthenticatedContext added in v4.12.0

func (c *Client) CreateAuthenticatedContext(ctx context.Context) (context.Context, error)

func (*Client) GetZone

func (c *Client) GetZone(ctx context.Context, domain string) (*Response, error)

GetZone returns content of DNS zone for domain.

func (*Client) Logout

func (c *Client) Logout(ctx context.Context) (*Response, error)

Logout closes authenticated session with Joker's DMAPI.

func (*Client) PutZone

func (c *Client) PutZone(ctx context.Context, domain, zone string) (*Response, error)

PutZone uploads DNS zone to Joker DMAPI.

type Response

type Response struct {
	Headers    url.Values
	Body       string
	StatusCode int
	StatusText string
	AuthSid    string
}

Response Joker DMAPI Response.

type Token added in v4.12.0

type Token struct {
	SessionID string
	ExpireAt  time.Time
}

Token session ID. > Every request (except "login") requires the presence of the Auth-Sid variable ("Session ID"), > which is returned by the "login" request (login). An active session will expire after some inactivity period (default: 1 hour). https://joker.com/faq/content/22/12/en/commonalities-for-all-requests.html

Jump to

Keyboard shortcuts

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