v1

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnwrapError

func UnwrapError(r *http.Response) error

Types

type Client

type Client struct {
	BaseURL *url.URL

	Concepts     ConceptsService
	Repositories RepositoriesService
	// contains filtered or unexported fields
}

func NewClient

func NewClient(c *http.Client, baseURL *url.URL) *Client

func (*Client) Do

func (c *Client) Do(ctx context.Context, req *http.Request, w interface{}) (*Response, error)

func (*Client) NewRequest

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

type ConceptsClient

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

func (ConceptsClient) Get

func (ConceptsClient) GetFromRepository

func (c ConceptsClient) GetFromRepository(ctx context.Context, repo string, identifier concepts.ConceptIdentifier) (*api.ConceptPayload, *Response, error)

func (ConceptsClient) List

func (ConceptsClient) ListByTag

func (c ConceptsClient) ListByTag(ctx context.Context, s string, options *ListOptions) (*api.ConceptsPayload, *Response, error)

func (ConceptsClient) ListFromRepository added in v0.7.0

func (c ConceptsClient) ListFromRepository(ctx context.Context, repo string, options *ListOptions) (*api.ConceptsPayload, *Response, error)

type ErrorResponse

type ErrorResponse struct {
	Response *http.Response

	Message string `json:"message"`
}

func (ErrorResponse) Error

func (e ErrorResponse) Error() string

type ListOptions

type ListOptions struct {
	// Which page to list.
	Page int `url:"page,omitempty"`

	// Results per page.
	Limit int `url:"limit,omitempty"`
}

ListOptions defines paramaters to be used with List Operations

type RepositoriesClient

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

func (RepositoriesClient) Delete

func (r RepositoriesClient) Delete(ctx context.Context, name string) (*Response, error)

func (RepositoriesClient) Get

func (RepositoriesClient) List

func (RepositoriesClient) Put added in v0.7.0

func (r RepositoriesClient) Put(ctx context.Context, name, giturl, gitref string) (*Response, error)

type RepositoriesService

type RepositoriesService interface {
	Get(ctx context.Context, name string) (*api.RepositoryPayload, *Response, error)
	List(ctx context.Context, options *ListOptions) (*api.RepositoriesPayload, *Response, error)
	Put(ctx context.Context, name, giturl, gitref string) (*Response, error)
	Delete(ctx context.Context, name string) (*Response, error)
}

type Response

type Response struct {
	*http.Response
}

func UnwrapResponse

func UnwrapResponse(r *http.Response) *Response

Jump to

Keyboard shortcuts

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