v1

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseResponse

type BaseResponse struct {
	Status int         `json:"-"`
	Errors []RespError `json:"errors"`
	Data   interface{} `json:"data"`
}

func NewBaseResponse

func NewBaseResponse() *BaseResponse

func (*BaseResponse) ParseError

func (r *BaseResponse) ParseError(err error)

func (*BaseResponse) SetData

func (r *BaseResponse) SetData(v interface{})

func (*BaseResponse) Write

func (r *BaseResponse) Write(ctx context.Context, w http.ResponseWriter, log Logger)

type EntryHandlers

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

func NewEntryHandlers

func NewEntryHandlers(
	service EntryService,
	logger tracelog.Logger,
	tracer *tracing.Tracer,
) *EntryHandlers

func (*EntryHandlers) PingHandler

func (h *EntryHandlers) PingHandler(w http.ResponseWriter, r *http.Request)

func (*EntryHandlers) StoreItemHandler

func (h *EntryHandlers) StoreItemHandler(w http.ResponseWriter, r *http.Request)

func (*EntryHandlers) StoreListHandler

func (h *EntryHandlers) StoreListHandler(w http.ResponseWriter, r *http.Request)

type EntryService

type EntryService interface {
	Ping(ctx context.Context) error
	StoreItem(ctx context.Context, remoteIP string, data []byte) (err error)
	StoreList(ctx context.Context, remoteIP string, data []byte) (err error)
}

type InfoHandlers

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

func NewInfoHandlers

func NewInfoHandlers(logger tracelog.Logger) *InfoHandlers

func (*InfoHandlers) InfoHandler

func (h *InfoHandlers) InfoHandler(w http.ResponseWriter, r *http.Request)

type Logger

type Logger interface {
	Errorf(ctx context.Context, template string, args ...interface{})
}

type RespError

type RespError struct {
	Code   string `json:"code"`
	Detail string `json:"detail"`
}

Jump to

Keyboard shortcuts

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