service

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const DockerHubAPI = "https://registry.hub.docker.com/v2/"

DockerHubAPI const

Variables

This section is empty.

Functions

func IsEmpty added in v0.1.23

func IsEmpty(input string) bool

IsEmpty if field is empty

func NotEmpty added in v0.1.23

func NotEmpty(input string) error

NotEmpty returns error if input is empty

func Optional added in v0.1.23

func Optional(_ string) error

Optional optional value

Types

type DockerHub added in v0.2.1

type DockerHub struct {
	// contains filtered or unexported fields
}

DockerHub struct

func NewDockerHub added in v0.2.1

func NewDockerHub(httpClient *HTTPClient) *DockerHub

NewDockerHub creates an instance of http client

func (*DockerHub) GetTags added in v0.2.1

func (d *DockerHub) GetTags(ctx context.Context, org, image string) ([]string, error)

GetTags get image tags

type FuzzyFinder added in v0.1.23

type FuzzyFinder struct{}

FuzzyFinder type

func (*FuzzyFinder) Available added in v0.1.23

func (f *FuzzyFinder) Available() bool

Available validates if fzf installed

func (*FuzzyFinder) Show added in v0.1.23

func (f *FuzzyFinder) Show(items []string) (string, error)

Show shows a fzf list

type HTTPClient

type HTTPClient struct {
	Timeout time.Duration
}

HTTPClient struct

func NewHTTPClient

func NewHTTPClient(timeout int) *HTTPClient

NewHTTPClient creates an instance of http client

func (*HTTPClient) BuildData

func (h *HTTPClient) BuildData(parameters map[string]string) string

BuildData build body data

func (*HTTPClient) Delete

func (h *HTTPClient) Delete(ctx context.Context, endpoint string, parameters, headers map[string]string) (*http.Response, error)

Delete http call

func (*HTTPClient) Get

func (h *HTTPClient) Get(ctx context.Context, endpoint string, parameters, headers map[string]string) (*http.Response, error)

Get http call

func (*HTTPClient) GetHeaderValue

func (h *HTTPClient) GetHeaderValue(response *http.Response, key string) string

GetHeaderValue get response header value

func (*HTTPClient) GetStatusCode

func (h *HTTPClient) GetStatusCode(response *http.Response) int

GetStatusCode response status code

func (*HTTPClient) Patch

func (h *HTTPClient) Patch(ctx context.Context, endpoint string, data string, parameters, headers map[string]string) (*http.Response, error)

Patch http call

func (*HTTPClient) Post

func (h *HTTPClient) Post(ctx context.Context, endpoint string, data string, parameters, headers map[string]string) (*http.Response, error)

Post http call

func (*HTTPClient) Put

func (h *HTTPClient) Put(ctx context.Context, endpoint string, data string, parameters, headers map[string]string) (*http.Response, error)

Put http call

func (*HTTPClient) ToString

func (h *HTTPClient) ToString(response *http.Response) (string, error)

ToString response body to string

type Prometheus added in v0.1.1

type Prometheus struct{}

Prometheus struct

func NewPrometheus added in v0.1.1

func NewPrometheus() *Prometheus

NewPrometheus create a new instance of prometheus backend

func (*Prometheus) Counter added in v0.1.1

func (p *Prometheus) Counter(item model.Metric) error

Counter updates or creates a counter

func (*Prometheus) Gauge added in v0.1.1

func (p *Prometheus) Gauge(item model.Metric) error

Gauge updates or creates a gauge

func (*Prometheus) Histogram added in v0.1.1

func (p *Prometheus) Histogram(item model.Metric) error

Histogram updates or creates a histogram

func (*Prometheus) Send added in v0.1.1

func (p *Prometheus) Send(metrics []model.Metric) error

Send sends metrics to prometheus

func (*Prometheus) Summary added in v0.1.1

func (p *Prometheus) Summary(item model.Metric) error

Summary updates or creates a summary

type Prompt added in v0.1.23

type Prompt struct {
}

Prompt struct

func (*Prompt) Input added in v0.1.23

func (p *Prompt) Input(label string, validate promptui.ValidateFunc) (string, error)

Input request a value from end user

func (*Prompt) Select added in v0.1.23

func (p *Prompt) Select(label string, items []string) (string, error)

Select request a value from a list from end user

type TagsResponse added in v0.2.1

type TagsResponse struct {
	Results []struct {
		ID   int    `json:"id"`
		Name string `json:"name"`
	} `json:"results"`
}

TagsResponse type

func (*TagsResponse) ConvertToJSON added in v0.2.1

func (t *TagsResponse) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*TagsResponse) LoadFromJSON added in v0.2.1

func (t *TagsResponse) LoadFromJSON(data []byte) error

LoadFromJSON update object from json

Jump to

Keyboard shortcuts

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