cfp

package
v0.0.0-...-074db7c Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SpeakerPath  = "/api/speakers"
	ProposalPath = "/api/proposals"
)

Variables

View Source
var (
	ErrCreateRequest  = ErrorReason{Reason: "InvalidRequest", Summary: "invalid request"}
	ErrMakeRequest    = ErrorReason{Reason: "RequestFailed", Summary: "request failed"}
	ErrCreateSpeaker  = ErrorReason{Reason: "CreateSpeakerFailed", Summary: "error creating speaker"}
	ErrUpdateSpeaker  = ErrorReason{Reason: "UpdateSpeakerFailed", Summary: "error updating speaker"}
	ErrFetchSpeaker   = ErrorReason{Reason: "FetchSpeakerFailed", Summary: "error fetching speaker"}
	ErrDeleteSpeaker  = ErrorReason{Reason: "DeleteSpeakerFailed", Summary: "error deleting speaker"}
	ErrCreateProposal = ErrorReason{Reason: "CreateProposalFailed", Summary: "error creating proposal"}
	ErrUpdateProposal = ErrorReason{Reason: "UpdateProposalFailed", Summary: "error updating proposal"}
	ErrFetchProposal  = ErrorReason{Reason: "FetchProposalFailed", Summary: "error fetching proposal"}
	ErrDeleteProposal = ErrorReason{Reason: "DeleteProposalFailed", Summary: "error deleting proposal"}
	ErrUnknown        = ErrorReason{Reason: "Unknown", Summary: "unknown error"}
)

Functions

This section is empty.

Types

type Client

type Client struct {
	Client *http.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(endpoint string, client *http.Client) (*Client, error)

func (*Client) Create

func (c *Client) Create(ctx context.Context, path string, body []byte) ([]byte, error)

func (*Client) Delete

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

func (*Client) Get

func (c *Client) Get(ctx context.Context, path, id string) ([]byte, error)

func (*Client) Update

func (c *Client) Update(ctx context.Context, path, id string, body []byte) ([]byte, error)

type Error

type Error struct {
	Reason ErrorReason
	Err    error
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) Is

func (e *Error) Is(target error) bool

type ErrorReason

type ErrorReason struct {
	Reason  string
	Summary string
}

func (ErrorReason) Error

func (e ErrorReason) Error() string

Jump to

Keyboard shortcuts

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