metros

package
v0.5.9 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const Endpoint = "/metros"

Endpoint is the public path for the metros service. Currently unused.

Variables

This section is empty.

Functions

This section is empty.

Types

type ListResponseItem

type ListResponseItem struct {
	Code     string        `json:"code"`
	Delay    time.Duration `json:"delay"`
	Ipv4     string        `json:"ipv4"`
	Location string        `json:"location"`
	Online   bool          `json:"online"`
	Proxy    string        `json:"proxy"`

	kcclient.APIResponseCommon
}

ListResponseItem is a data item from a response to a /metros/list request. https://docs.kraft.cloud/api/v1/metros/#list-existing-metros

type MetrosService

type MetrosService interface {
	kcclient.ServiceClient[MetrosService]

	// Lists all existing metros. This list is currently hard-coded so the
	// returned result is always the same.
	//
	// See: https://docs.kraft.cloud/api/v1/metros/#list-existing-metros
	List(ctx context.Context, status bool) ([]ListResponseItem, error)
}

func NewMetrosClientFromOptions

func NewMetrosClientFromOptions(opts *options.Options) MetrosService

NewMetrosClientFromOptions instantiates a new metro client based on the provided pre-existing options.

Jump to

Keyboard shortcuts

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