api

package
v0.0.0-...-eac6ddc Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2021 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArrayResponse

type ArrayResponse []string

type Config

type Config struct {
	HttpClientTimeout         time.Duration `mapstructure:"HTTP_CLIENT_TIMEOUT_IN_MINUTES"`
	HttpServerTimeout         time.Duration `mapstructure:"HTTP_SERVER_TIMEOUT_IN_SECONDS"`
	HttpServerShutdownTimeout time.Duration `mapstructure:"HTTP_SERVER_SHUTDOWN_TIMEOUT_IN_SECONDS"`
	BackendURL                []string      `mapstructure:"BACKEND_SERVICE_URLS"`
	UIMessage                 string        `mapstructure:"UI_MESSAGE"`
	UIColor                   string        `mapstructure:"UI_COLOR"`
	UIPath                    string        `mapstructure:"UI_PATH"`
	DataPath                  string        `mapstructure:"DATA_PATH"`
	ConfigPath                string        `mapstructure:"CONFIG_PATH"`
	CertPath                  string        `mapstructure:"CERT_PATH"`
	Port                      string        `mapstructure:"HTTP_PORT"`
	SecurePort                string        `mapstructure:"HTTPS_PORT"`
	PortMetrics               int           `mapstructure:"METRICS_PORT"`
	Hostname                  string        `mapstructure:"HOSTNAME"`
	H2C                       bool          `mapstructure:"H2C"`
	RandomDelay               bool          `mapstructure:"ENABLE_RANDOM_DELAY"`
	RandomDelayUnit           string        `mapstructure:"RANDOM_DELAY_UNIT"`
	RandomDelayMin            int           `mapstructure:"RANDOM_DELAY_MIN"`
	RandomDelayMax            int           `mapstructure:"RANDOM_DELAY_MAX"`
	RandomError               bool          `mapstructure:"ENABLE_RANDOM_ERROR"`
	Unhealthy                 bool          `mapstructure:"SET_SERVICE_UNHEALTHY"`
	Unready                   bool          `mapstructure:"SET_SERVICE_UNREADY"`
	JWTSecret                 string        `mapstructure:"JWT_SECRET"`
	CacheServer               string        `mapstructure:"CACHE_SERVER_ADDRESS"`
	ServiceName               string        `mapstructure:"GRPC_SERVICE_NAME"`
	StripeApiKey              string        `mapstructure:"STRIPE_API_KEY"`
}

type MapResponse

type MapResponse map[string]string

type RuntimeResponse

type RuntimeResponse struct {
	Hostname     string `json:"hostname"`
	Version      string `json:"version"`
	Revision     string `json:"revision"`
	Color        string `json:"color"`
	Message      string `json:"message"`
	GOOS         string `json:"goos"`
	GOARCH       string `json:"goarch"`
	Runtime      string `json:"runtime"`
	NumGoroutine string `json:"num_goroutine"`
	NumCPU       string `json:"num_cpu"`
}

type Server

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

func NewMockServer

func NewMockServer() *Server

func NewServer

func NewServer(config *Config, logger *zap.Logger, authCmp *authentication_handler.AuthenticationComponent, merchantCmp *merchant.AccountComponent) (*Server, error)

func (*Server) ErrorResponse

func (s *Server) ErrorResponse(w http.ResponseWriter, r *http.Request, error string, code int)

func (*Server) JSONResponse

func (s *Server) JSONResponse(w http.ResponseWriter, r *http.Request, result interface{})

func (*Server) JSONResponseCode

func (s *Server) JSONResponseCode(w http.ResponseWriter, r *http.Request, result interface{}, responseCode int)

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(stopCh <-chan struct{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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