http

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: Apache-2.0 Imports: 4 Imported by: 2

README

Http

Go Reference Bitbucket Pipelines

Installation

go get bitbucket.org/amotus/http

Usages

Maintainers

License

Licensed under Apache License, Version 2.0 LICENSE.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Headerer
	Get(route string, headers ...Header) ([]byte, error, int)
	Post(route string, jsonBody []byte, headers ...Header) ([]byte, error, int)
	Put(route string, jsonBody []byte, headers ...Header) ([]byte, error, int)
	Delete(route string, headers ...Header) ([]byte, error, int)
}

func NewHttpClient

func NewHttpClient(config Config, optionals ...ConfigFunc) Client

NewHttpClient creates a new http client with the given configuration and transport. If transport is nil, the default http client is used.

type Config

type Config struct {
	BaseHeaders []Header
	BaseUrl     string
}

type ConfigFunc added in v0.0.3

type ConfigFunc func(*http.Client)

func WithTransport added in v0.0.3

func WithTransport(t http.Transport) ConfigFunc
type Header struct {
	Key   string
	Value string
}

type Headerer

type Headerer interface {
	Headers() []Header
	WithHeaders(h []Header) Client
}

Jump to

Keyboard shortcuts

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