client

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: AGPL-3.0 Imports: 9 Imported by: 2

Documentation

Overview

Package client implements a client for a build service

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBuildFailed   = errors.New("build failed")   //nolint:revive
	ErrRequestFailed = errors.New("request failed") //nolint:revive
)

Functions

func NewBuildServiceClient

func NewBuildServiceClient(config BuildServiceClientConfig) (k6build.BuildService, error)

NewBuildServiceClient returns a new client for a remote build service

Types

type BuildClient

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

BuildClient defines a client of a build service

func (*BuildClient) Build

func (r *BuildClient) Build(
	ctx context.Context,
	platform string,
	k6Constrains string,
	deps []k6build.Dependency,
) (k6build.Artifact, error)

Build request building an artidact to a build service

type BuildServiceClientConfig

type BuildServiceClientConfig struct {
	// URL to build service
	URL string
	// Authorization credentials passed in the Authorization: <type> <credentials> header
	// See AuthorizationType
	Authorization string
	// AuthorizationType type of credentials in the Authorization: <type> <credentials> header
	// For example, "Bearer", "Token", "Basic". Defaults to "Bearer"
	AuthorizationType string
	// Headers custom request headers
	Headers map[string]string
}

BuildServiceClientConfig defines the configuration for accessing a remote build service

Jump to

Keyboard shortcuts

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