api

package module
v0.0.0-...-0f03711 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

README

Openchangelog API

The github.com/jonashiltl/openchangelog/api package holds the Golang API Client to interact with the Openchangelog API.

Documentation

Index

Constants

View Source
const (
	DefaultAddress = "https://localhost:6001/api"
	AuthHeader     = "Authorization"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiError

type ApiError struct {
	// HTTPMethod is the HTTP method for the request (PUT, GET, etc).
	HTTPMethod string

	// URL is the URL of the request.
	URL string

	// StatusCode is the HTTP status code.
	StatusCode int

	Message string
}

func (ApiError) Error

func (a ApiError) Error() string

type Changelog

type Changelog = apitypes.Changelog

type Client

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

func NewClient

func NewClient(c *Config) (*Client, error)

func (*Client) CreateChangelog

func (c *Client) CreateChangelog(ctx context.Context, args apitypes.CreateChangelogBody) (Changelog, error)

func (*Client) CreateGHSource

func (c *Client) CreateGHSource(ctx context.Context, args CreateGHSourceBody) (GHSource, error)

func (*Client) CreateWorkspace

func (c *Client) CreateWorkspace(ctx context.Context, args apitypes.CreateWorkspaceBody) (Workspace, error)

func (*Client) DeleteChangelog

func (c *Client) DeleteChangelog(ctx context.Context, changelogID string) error

func (*Client) DeleteChangelogSource

func (c *Client) DeleteChangelogSource(ctx context.Context, changelogID string) error

func (*Client) DeleteGHSource

func (c *Client) DeleteGHSource(ctx context.Context, sourceID string) error

func (*Client) DeleteWorkspace

func (c *Client) DeleteWorkspace(ctx context.Context, id string) error

func (*Client) GetChangelog

func (c *Client) GetChangelog(ctx context.Context, changelogID string) (Changelog, error)

func (*Client) GetFullChangelog

func (c *Client) GetFullChangelog(ctx context.Context, args GetFullChangelogParams) (FullChangelog, error)

func (*Client) ListChangelogs

func (c *Client) ListChangelogs(ctx context.Context) ([]Changelog, error)

func (*Client) ListSources

func (c *Client) ListSources(ctx context.Context) ([]Source, error)

func (*Client) NewRequest

func (c *Client) NewRequest(ctx context.Context, method, requestPath string, body io.Reader) (*http.Request, error)

func (*Client) SetChangelogSource

func (c *Client) SetChangelogSource(ctx context.Context, changelogID string, sourceID string) error

func (*Client) UpdateChangelog

func (c *Client) UpdateChangelog(ctx context.Context, changelogID string, args apitypes.UpdateChangelogBody) (Changelog, error)

type Config

type Config struct {
	AuthToken  string
	Address    string
	HttpClient *http.Client
}

Config is used to configure the creation of the client.

func DefaultConfig

func DefaultConfig() (*Config, error)

type CreateGHSourceBody

type CreateGHSourceBody = apitypes.CreateGHSourceBody

type FullChangelog

type FullChangelog = apitypes.FullChangelog

type GHSource

type GHSource = apitypes.CreateGHSourceBody

type GetFullChangelogParams

type GetFullChangelogParams struct {
	ChangelogID string
	Page        int
	PageSize    int
}

type Response

type Response struct {
	*http.Response
}

func (*Response) DecodeJSON

func (r *Response) DecodeJSON(out interface{}) error

DecodeJSON will decode the response body to a JSON structure. This will consume the response body, but will not close it. Close must still be called.

func (*Response) Error

func (r *Response) Error() error

Error returns an error response if there is one. If there is an error, this will fully consume the response body, but will not close it. The body must still be closed manually.

type Source

type Source = apitypes.Source

type Workspace

type Workspace = apitypes.Workspace

Jump to

Keyboard shortcuts

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