client

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Server string // GITGUARDIAN_SERVER
	ApiKey string // GITGUARDIAN_API_KEY
	Client HttpRequest
}

func New

func New(opts ...ClientOption) (*Client, error)

func (*Client) NewRequest

func (c *Client) NewRequest(method string, path string, body interface{}) (*http.Request, error)

type ClientOption

type ClientOption func(*Client) error

func WithApiKey

func WithApiKey(apiKey string) ClientOption

func WithHTTPClient

func WithHTTPClient(ht HttpRequest) ClientOption

func WithServer

func WithServer(server string) ClientOption

type Error added in v0.3.0

type Error struct {
	Detail string `json:"detail"`
}

type HttpRequest

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

type PaginationMeta added in v0.2.0

type PaginationMeta struct {
	NextCursor     string
	PreviousCursor string
}

func GetPaginationMeta added in v0.2.0

func GetPaginationMeta(r *http.Response) (*PaginationMeta, error)

Jump to

Keyboard shortcuts

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