api

package
v0.0.0-...-4cc3681 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnreachable      = errors.New("server unreachable")
	ErrAuthentication   = errors.New("authentication failed")
	ErrWrongContentType = errors.New("wrong content type")
	ErrParsing          = errors.New("parsing error")
)

Functions

func GET

func GET(ctx context.Context, path string, opts *Options, target interface{}) error

func POST

func POST(ctx context.Context, path string, source interface{}) error

func PUT

func PUT(ctx context.Context, path string, source interface{}) error

Types

type Options

type Options struct {
	Sort   string
	Limit  int
	Offset int
	Filter map[string]string
}

type Response

type Response struct {
	Status     string `json:"status"`
	Message    string `json:"message"`
	StatusCode int    `json:"code"`
}

func (Response) Error

func (e Response) Error() string

type Timestamp

type Timestamp struct {
	time.Time
}

func (*Timestamp) MarshalJSON

func (u *Timestamp) MarshalJSON() ([]byte, error)

func (*Timestamp) UnmarshalJSON

func (u *Timestamp) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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