api

package
v0.0.0-...-7ee3c9b Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2019 License: MIT Imports: 41 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"`
	HttpServerTimeout         time.Duration `mapstructure:"http-server-timeout"`
	HttpServerShutdownTimeout time.Duration `mapstructure:"http-server-shutdown-timeout"`
	BackendURL                []string      `mapstructure:"backend-url"`
	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"`
	Port                      string        `mapstructure:"port"`
	PortMetrics               int           `mapstructure:"port-metrics"`
	Hostname                  string        `mapstructure:"hostname"`
	H2C                       bool          `mapstructure:"h2c"`
	RandomDelay               bool          `mapstructure:"random-delay"`
	RandomError               bool          `mapstructure:"random-error"`
	JWTSecret                 string        `mapstructure:"jwt-secret"`
}

type FluxConfig

type FluxConfig struct {
	GitUrl    string `mapstructure:"git-url"`
	GitBranch string `mapstructure:"git-branch"`
}

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, endpoint string) (*Server, error)

func (*Server) ConnectToDatabase

func (s *Server) ConnectToDatabase() (*gorm.DB, error)

InitDbConnection initializes a database connection and creates associated tables/migrates schemas

func (*Server) ConnectToQueues

func (s *Server) ConnectToQueues() (amqp.Queue, amqp.Queue)

InitQueues initializes a set of producer and consumer amqp queues to be used for things such as account registration emails amongst many others.

func (*Server) CreateTablesOrMigrateSchemas

func (s *Server) CreateTablesOrMigrateSchemas(db *gorm.DB)

CreateTablesOrMigrateSchemas creates a given set of tables based on a schema if it does not exist or migrates the table schemas to the latest version

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{})

func (*Server) NewZipkinTracer

func (s *Server) NewZipkinTracer() (*zipkin.Tracer, error)

type TokenResponse

type TokenResponse struct {
	Token     string    `json:"token"`
	ExpiresAt time.Time `json:"expires_at"`
}

type TokenValidationResponse

type TokenValidationResponse struct {
	TokenName string    `json:"token_name"`
	ExpiresAt time.Time `json:"expires_at"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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