http

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpServer

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

func NewHttpServer

func NewHttpServer(approvalService *approval.ApprovalService, registry *prometheus.Registry, logger *zerolog.Logger) *HttpServer

func (*HttpServer) GetTokenRecoverApproval

func (server *HttpServer) GetTokenRecoverApproval(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

func (*HttpServer) Ping

func (server *HttpServer) Ping(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

func (*HttpServer) Response

func (server *HttpServer) Response(w http.ResponseWriter, code ResponseCode, data interface{}, err error)

func (*HttpServer) Run

func (server *HttpServer) Run(config config.HTTPConfig) error

func (*HttpServer) RunMetrics

func (server *HttpServer) RunMetrics(config config.MetricsConfig) error

func (*HttpServer) Shutdown

func (server *HttpServer) Shutdown() error

type Response

type Response struct {
	Code  ResponseCode `json:"code"`
	Data  interface{}  `json:"data,omitempty"`
	Error string       `json:"error,omitempty"`
}

func (*Response) Marshal

func (r *Response) Marshal() string

type ResponseCode

type ResponseCode int
const (
	Success ResponseCode = iota
	InvalidRequest
)

Jump to

Keyboard shortcuts

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