guard

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2024 License: GPL-3.0 Imports: 13 Imported by: 4

Documentation

Overview

Copyright © 2024-2025 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.

Copyright © 2021-2023 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtefactWriter added in v0.5.0

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

func NewArtefactWriter added in v0.5.0

func NewArtefactWriter(file string) (*ArtefactWriter, error)

func (*ArtefactWriter) Blake2b added in v0.6.0

func (a *ArtefactWriter) Blake2b() string

func (*ArtefactWriter) Close added in v0.5.0

func (a *ArtefactWriter) Close() error

func (*ArtefactWriter) GetCount added in v0.5.0

func (a *ArtefactWriter) GetCount() int64

func (*ArtefactWriter) GetPath added in v0.5.0

func (a *ArtefactWriter) GetPath() string

func (*ArtefactWriter) MD5 added in v0.5.0

func (a *ArtefactWriter) MD5() string

func (*ArtefactWriter) Sha512 added in v0.6.0

func (a *ArtefactWriter) Sha512() string

func (*ArtefactWriter) Write added in v0.5.0

func (a *ArtefactWriter) Write(p []byte) (int, error)

type RestGuard

type RestGuard struct {
	Client    *http.Client `json:"-" yaml:"-"`
	UserAgent string       `json:"user_agent,omitempty" yaml:"user_agent,omitempty"`

	Services map[string]*specs.RestService `json:"services" yaml:"services"`
	RetryCb  func(guard *RestGuard, t *specs.RestTicket) (*specs.RestNode, error)
}

func NewRestGuard

func NewRestGuard(cfg *specs.RestGuardConfig) (*RestGuard, error)

func (*RestGuard) AddRestNode

func (g *RestGuard) AddRestNode(srv string, n *specs.RestNode) error

func (*RestGuard) AddService

func (g *RestGuard) AddService(srv string, s *specs.RestService)

func (*RestGuard) CreateRequest

func (g *RestGuard) CreateRequest(t *specs.RestTicket, method, path string) (*http.Request, error)

func (*RestGuard) Do

func (g *RestGuard) Do(t *specs.RestTicket) error

func (*RestGuard) DoDownload added in v0.5.0

func (g *RestGuard) DoDownload(t *specs.RestTicket, artefactPath string) (*specs.RestArtefact, error)

func (*RestGuard) DoWithTimeout added in v0.3.0

func (g *RestGuard) DoWithTimeout(t *specs.RestTicket, timeoutSec int) error

func (*RestGuard) GetService

func (g *RestGuard) GetService(srv string) (*specs.RestService, error)

func (*RestGuard) GetUserAgent

func (g *RestGuard) GetUserAgent() string

Jump to

Keyboard shortcuts

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