endpoints

package
v0.0.0-...-debbccd Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeAddEndpoint

func MakeAddEndpoint(svc database.Service) endpoint.Endpoint

func MakeGetEndpoint

func MakeGetEndpoint(svc database.Service) endpoint.Endpoint

func MakeRemoveEndpoint

func MakeRemoveEndpoint(svc database.Service) endpoint.Endpoint

func MakeServiceStatusEndpoint

func MakeServiceStatusEndpoint(svc database.Service) endpoint.Endpoint

func MakeUpdateEndpoint

func MakeUpdateEndpoint(svc database.Service) endpoint.Endpoint

Types

type AddRequest

type AddRequest struct {
	Document *internal.Document `json:"document"`
}

type AddResponse

type AddResponse struct {
	TicketID string `json:"ticketID"`
	Err      string `json:"err"`
}

type GetRequest

type GetRequest struct {
	Filters []internal.Filter `json:"filters,omitempty"`
}

type GetResponse

type GetResponse struct {
	Documents []internal.Document `json:"documents"`
	Err       string              `json:"err,omitempty"`
}

type RemoveRequest

type RemoveRequest struct {
	TicketID string `json:"ticketID"`
}

type RemoveResponse

type RemoveResponse struct {
	Code int    `json:"code"`
	Err  string `json:"err"`
}

type ServiceStatusRequest

type ServiceStatusRequest struct{}

type ServiceStatusResponse

type ServiceStatusResponse struct {
	Code int    `json:"code"`
	Err  string `json:"err,omitempty"`
}

type Set

type Set struct {
	GetEndpoint           endpoint.Endpoint
	AddEndpoint           endpoint.Endpoint
	UpdateEndpoint        endpoint.Endpoint
	RemoveEndpoint        endpoint.Endpoint
	ServiceStatusEndpoint endpoint.Endpoint
}

func NewEndpointSet

func NewEndpointSet(svc database.Service) Set

func (*Set) Add

func (s *Set) Add(ctx context.Context, doc *internal.Document) (string, error)

func (*Set) Get

func (s *Set) Get(ctx context.Context, filters ...internal.Filter) ([]internal.Document, error)

func (*Set) Remove

func (s *Set) Remove(ctx context.Context, ticketID string) (int, error)

func (*Set) ServiceStatus

func (s *Set) ServiceStatus(ctx context.Context) (int, error)

func (*Set) Update

func (s *Set) Update(ctx context.Context, ticketID string, doc *internal.Document) (int, error)

type UpdateRequest

type UpdateRequest struct {
	TicketID string             `json:"ticketID"`
	Document *internal.Document `json:"document"`
}

type UpdateResponse

type UpdateResponse struct {
	Code int    `json:"code"`
	Err  string `json:"err,omitempty"`
}

Jump to

Keyboard shortcuts

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