rest

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContentJSON  = "application/json"
	ContentProto = "application/proto"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

func NewHandler

func NewHandler(collector collection.Collector) *Handler

func (*Handler) Ack

func (h *Handler) Ack(rw http.ResponseWriter, resChannel chan struct{}, s serialization.SerializeFunc, reqGuid string, connGroup string) collection.AckFunc

func (*Handler) RESTAPIHandler

func (h *Handler) RESTAPIHandler(rw http.ResponseWriter, r *http.Request)

type Response

type Response struct {
	*pb.SendEventResponse
}

func (*Response) SetCode

func (r *Response) SetCode(code pb.Code) *Response

func (*Response) SetDataMap

func (r *Response) SetDataMap(data map[string]string) *Response

func (*Response) SetReason

func (r *Response) SetReason(reason string) *Response

func (*Response) SetSentTime

func (r *Response) SetSentTime(sentTime int64) *Response

func (*Response) SetStatus

func (r *Response) SetStatus(status pb.Status) *Response

func (*Response) Write

type Service

type Service struct {
	Collector collection.Collector
	// contains filtered or unexported fields
}

func NewRestService

func NewRestService(c collection.Collector) *Service

func (*Service) Init

func (s *Service) Init(context.Context) error

func (*Service) Name

func (*Service) Name() string

func (*Service) Shutdown

func (s *Service) Shutdown(ctx context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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