client

package module
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: MIT Imports: 11 Imported by: 4

README

dp-nomad

Getting started
Dependencies
Configuration
Contributing

See CONTRIBUTING for details.

License

Copyright © 2020, Office for National Statistics (https://www.ons.gov.uk)

Released under MIT license, see LICENSE for details.

Documentation

Index

Constants

View Source
const ServiceName = "Nomad"

ServiceName

Variables

View Source
var (
	// StatusMessage contains a map of messages to service response statuses
	StatusMessage = map[string]string{
		health.StatusOK:       " is ok",
		health.StatusWarning:  " is degraded, but at least partially functioning",
		health.StatusCritical: " functionality is unavailable or non-functioning",
	}
)

Functions

This section is empty.

Types

type Client added in v0.2.0

type Client struct {
	Client dphttp.Clienter
	URL    string
}

Nomad represents the nomad client

func NewClient

func NewClient(nomadEndpoint, nomadCACert string, nomadTLSSkipVerify bool) (*Client, error)

NewClient returns a Nomad HTTP client for this endpoint with optional TLS config

func (*Client) Checker added in v0.2.0

func (c *Client) Checker(ctx context.Context, state *health.CheckState) error

func (*Client) Get added in v0.2.0

func (c *Client) Get(ctx context.Context, path string) (int, error)

type ErrInvalidAppResponse added in v0.2.0

type ErrInvalidAppResponse struct {
	ExpectedCode int
	ActualCode   int
	URI          string
}

ErrInvalidAppResponse is returned when an app does not respond with a valid status

func (ErrInvalidAppResponse) Error added in v0.2.0

func (e ErrInvalidAppResponse) Error() string

Error should be called by the user to print out the stringified version of the error

Jump to

Keyboard shortcuts

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