{"modulePath":"github.com/libdns/noderings","version":"v0.1.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package noderings\n\nPackage noderings implements a DNS record management client compatible with the libdns interfaces for NodeRings DNS ([https://noderings.com](https://noderings.com)).\n\nNodeRings stores records as record sets: all records with the same name and type share one TTL and are written together. AppendRecords, SetRecords and DeleteRecords therefore read the affected record sets, change them and write them back. Calls on one Provider are serialized so concurrent changes to the same record set (for example the two TXT values of a wildcard certificate) cannot overwrite each other. Changes are not atomic across record sets: if a call fails, record sets written before the failure keep their new contents.\n\nDNSSEC records are managed by NodeRings and are not returned by the API.\n\n## Constants\n\n```go\nconst (\n\tEnvAPIToken       = \"NODERINGS_API_TOKEN\"\n\tEnvOrganizationID = \"NODERINGS_ORGANIZATION_ID\"\n\tEnvAPIURL         = \"NODERINGS_API_URL\"\n)\n```\nEnvironment variables used when the matching Provider field is empty.\n\n```go\nconst DefaultAPIURL = \"https://api.noderings.com\"\n```\nDefaultAPIURL is the NodeRings API used when BaseURL is empty.\n\n## Types\n\n```go\ntype APIError struct {\n\tStatusCode int\n\tMessage    string\n}\n```\nAPIError is an error answer from the NodeRings API.\n\n```go\nfunc (e *APIError) Error() string\n```\n\n```go\ntype Provider struct {\n\t// APIToken is a NodeRings user API token or service account token.\n\t// Defaults to $NODERINGS_API_TOKEN.\n\tAPIToken string `json:\"api_token,omitempty\"`\n\n\t// OrganizationID selects the organization when the token belongs to more\n\t// than one. Defaults to $NODERINGS_ORGANIZATION_ID.\n\tOrganizationID string `json:\"organization_id,omitempty\"`\n\n\t// BaseURL of the NodeRings API. Defaults to $NODERINGS_API_URL, then\n\t// https://api.noderings.com.\n\tBaseURL string `json:\"base_url,omitempty\"`\n\n\t// HTTPClient used for API calls. Defaults to a client with a 30s timeout.\n\tHTTPClient *http.Client `json:\"-\"`\n\t// contains filtered or unexported fields\n}\n```\nProvider facilitates DNS record manipulation with NodeRings DNS.\n\n```go\nfunc (p *Provider) AppendRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)\n```\nAppendRecords adds records to the zone. It returns the records that were added. Records that already exist are left as they are and not returned. A record set that already exists keeps its TTL.\n\n```go\nfunc (p *Provider) DeleteRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)\n```\nDeleteRecords deletes the specified records from the zone. It returns the records that were deleted. Type, TTL and value may be left empty to match any.\n\n```go\nfunc (p *Provider) GetRecords(ctx context.Context, zone string) ([]libdns.Record, error)\n```\nGetRecords lists all the records in the zone.\n\n```go\nfunc (p *Provider) ListZones(ctx context.Context) ([]libdns.Zone, error)\n```\nListZones lists the zones the token can manage.\n\n```go\nfunc (p *Provider) SetRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)\n```\nSetRecords sets the records in the zone, either by updating existing records or creating new ones. For each (name, type) in the input, the input records become the only records of that set. All input records with the same name and type must have the same TTL. It returns the records that were set.\n\n","path":"github.com/libdns/noderings","name":"noderings","synopsis":"Package noderings implements a DNS record management client compatible with the libdns interfaces for NodeRings DNS (https://noderings.com).","isRedistributable":true}
