http

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: BSD-3-Clause Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Github    supportedProvider = "github"
	Bitbucket supportedProvider = "bitbucket"
)

Variables

View Source
var DefaultTimeout = 10 * time.Second

Functions

This section is empty.

Types

type Client

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

func New

func New(ctx context.Context, options ...Option) (*Client, error)

func (*Client) AuthHeader

func (c *Client) AuthHeader() string

func (*Client) Client

func (c *Client) Client() *http.Client

func (*Client) Context

func (c *Client) Context() context.Context

func (*Client) Delete

func (c *Client) Delete(path string, data interface{}, ret interface{}) error

func (*Client) Get

func (c *Client) Get(path string, ret interface{}) error

func (*Client) Post

func (c *Client) Post(path string, data interface{}, ret interface{}) error

func (*Client) Provider

func (c *Client) Provider() string

func (*Client) Put

func (c *Client) Put(path string, data interface{}, ret interface{}) error

func (*Client) Token

func (c *Client) Token() string

func (*Client) Url

func (c *Client) Url() string

type Option

type Option func(c *Client) error

func Auth

func Auth(token string) Option

Auth returns an Option that will set the auth token of the client

func Provider

func Provider(provider supportedProvider) Option

Provider returns an Option that will set the git provider of the client currently only github is supported

func Timeout

func Timeout(duration time.Duration) Option

Timeout returns an Option that will set the timeout of the client

func URL

func URL(url string) Option

URL returns an Option that will set the url of the auth server

func Unsecure

func Unsecure() Option

Unsecure returns an Option that will allow the client to connect to a server with an invalid certificate

Directories

Path Synopsis
git

Jump to

Keyboard shortcuts

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