contractclient

package
v0.0.0-...-426bf0d Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package contractclient interfaces with the Contracts Server backend.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client knows how to talk to the Contracts Server backend.

func New

func New(base *url.URL, doer HTTPDoer) *Client

New returns a Client instance caching a base URL.

func (*Client) GetProToken

func (c *Client) GetProToken(ctx context.Context, userJWT string) (token string, err error)

GetProToken returns the (possibly known) Pro Token provided by the Contract Server backend by POST'ing the user JWT.

func (*Client) GetServerAccessToken

func (c *Client) GetServerAccessToken(ctx context.Context) (token string, err error)

GetServerAccessToken returns a short-lived auth token identifying the Contract Server backend.

type HTTPDoer

type HTTPDoer interface {
	Do(*http.Request) (*http.Response, error)
}

HTTPDoer is an interface to allow injecting an HTTP Client.

Jump to

Keyboard shortcuts

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