onqlaveconnection

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OnqlaveAPIKey        string = "ONQLAVE-API-KEY"
	OnqlaveContent       string = "Content-Type"
	OnqlaveHost          string = "ONQLAVE-HOST"
	OnqlaveVersion       string = "ONQLAVE-VERSION"
	OnqlaveSignature     string = "ONQLAVE-SIGNATURE"
	OnqlaveDigest        string = "ONQLAVE-DIGEST"
	OnqlaveArx           string = "ONQLAVE-ARX"
	OnqlaveAgent         string = "User-Agent"
	OnqlaveRequestTime   string = "ONQLAVE-REQUEST-TIME"
	OnqlaveContentLength string = "ONQLAVE-CONTEXT-LEN"
)
View Source
const (
	ServerType       string = "Onqlave/0.1"
	Version          string = "0.1"
	Oonqlave_Content string = "application/json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Post(resource string, body requests.OnqlaveRequest, headers map[string]string) ([]byte, error)
}

func NewClient

func NewClient(retrySettings *RetrySettings, logger *onqlavelogger.Logger) Client

type Configuration

type Configuration struct {
	Credential *Credential
	Retry      *RetrySettings
	ArxURL     string
	ArxID      string
}

type Connection

type Connection interface {
	Post(resource string, body requests.OnqlaveRequest) ([]byte, *onqlaveerrors.OnqlaveError)
}

func NewConnection

func NewConnection(configuration *Configuration, hasher onqlaveutils.Hasher, logger *onqlavelogger.Logger) Connection

type Credential

type Credential struct {
	AccessKey  string
	SigningKey string
}

type RetrySettings

type RetrySettings struct {
	Count       int
	WaitTime    time.Duration
	MaxWaitTime time.Duration
}
var DefaultRetrySettings *RetrySettings = &RetrySettings{
	Count:       3,
	WaitTime:    400 * time.Millisecond,
	MaxWaitTime: 2000 * time.Millisecond,
}

func (*RetrySettings) Valid

func (s *RetrySettings) Valid() error

Jump to

Keyboard shortcuts

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