utils

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package utils contains our utilities functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddOptions added in v0.3.1

func AddOptions(s string, opt interface{}) (string, error)

AddOptions adds the options to the URL.

func ConstructFqdn added in v0.3.2

func ConstructFqdn(name, domain string) string

ConstructFqdn is a simple helper to handle mapping of partial names and shortcuts to full names.

func DeconstructFqdn added in v0.3.2

func DeconstructFqdn(name, domain string) string

DeconstructFqdn pulls off the suffix, the opposite of above and gives us an "@" for the apex.

func Encode

func Encode(v url.Values, keys []string) string

Encode generates a URL string in order.

Types

type MaybeBigInt added in v0.3.2

type MaybeBigInt int64

MaybeBigInt is a simple wrapper unmarshalling json responses that could be either an int or an int in a string.

func (*MaybeBigInt) UnmarshalJSON added in v0.3.2

func (fi *MaybeBigInt) UnmarshalJSON(b []byte) error

UnmarshalJSON is a helper interface for dealing with numbers that may be returned in json responses as either a string with a number in it or numbers.

type MaybeBool added in v0.3.2

type MaybeBool bool

MaybeBool is a simple wrapper unmarshalling json responses that could be either an int or an int in a string.

func (*MaybeBool) UnmarshalJSON added in v0.3.2

func (fi *MaybeBool) UnmarshalJSON(b []byte) error

UnmarshalJSON is a helper interface for dealing with things that may or may not be a string representing a bool, or number representing a bool.

type MaybeString added in v0.3.2

type MaybeString string

MaybeString is for things that may or may not be strings, but should be represented as a string.

func (*MaybeString) UnmarshalJSON added in v0.3.2

func (fi *MaybeString) UnmarshalJSON(b []byte) error

UnmarshalJSON is a helper interface for dealing with numbers that should be strings, but sometimes come through as number.

Jump to

Keyboard shortcuts

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