http

package
v0.1.0-rc.6 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: BSD-3-Clause Imports: 24 Imported by: 0

Documentation

Overview

Package http implements the HTTP server handlers for different resource endpoints

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CEEMSServer

type CEEMSServer struct {
	Querier     func(*sql.DB, Query, string, log.Logger) (interface{}, error)
	HealthCheck func(*sql.DB, log.Logger) bool
	// contains filtered or unexported fields
}

CEEMSServer struct implements HTTP server for stats

func NewCEEMSServer

func NewCEEMSServer(c *Config) (*CEEMSServer, func(), error)

NewCEEMSServer creates new CEEMSServer struct instance

func (*CEEMSServer) Shutdown

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

Shutdown server

func (*CEEMSServer) Start

func (s *CEEMSServer) Start() error

Start server

type Config

type Config struct {
	Logger           log.Logger
	Address          string
	WebSystemdSocket bool
	WebConfigFile    string
	DBConfig         db.Config
	MaxQueryPeriod   time.Duration
	AdminUsers       []string
	Grafana          *grafana.Grafana
}

Config makes a server config from CLI args

type Query

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

Query builder struct

type Response

type Response struct {
	Status    string      `json:"status"`
	Data      interface{} `json:"data,omitempty"`
	ErrorType errorType   `json:"errorType,omitempty"`
	Error     string      `json:"error,omitempty"`
	Warnings  []string    `json:"warnings,omitempty"`
}

Response defines the response model of CEEMSServer

Jump to

Keyboard shortcuts

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