api

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResourceSwaggerPathPrefix = "/swagger/"
)

Variables

This section is empty.

Functions

func LoggingMiddleware

func LoggingMiddleware(h http.HandlerFunc) http.HandlerFunc

LoggingMiddleware will log all incoming requests

func Use

func Use(h http.HandlerFunc, middleware ...func(http.HandlerFunc) http.HandlerFunc) http.HandlerFunc

Types

type Api

type Api struct {
	HttpServer *http.Server
	Mint       *mint.Mint
}

todo -- this responses are currently not used.

func New

func New() *Api

func (Api) StartServer

func (api Api) StartServer()

type Configuration

type Configuration struct {
	DocReference string `yaml:"doc_ref" json:"doc_ref"`
	LogLevel     string `yaml:"log_level" json:"log_level"`

	Mint struct {
		PrivateKey     string `json:"private_key" yaml:"private_key"`
		DerivationPath string `json:"derivation_path" yaml:"derivation_path"`
		Host           string `json:"host" yaml:"host"`
		Port           string `json:"port" yaml:"port"`
		Tls            struct {
			Enabled  bool   `json:"enabled" yaml:"enabled"`
			KeyFile  string `json:"key_path" yaml:"key_path"`
			CertFile string `json:"cert_path" yaml:"cert_path"`
		} `json:"tls" yaml:"tls"`
	} `json:"mint" yaml:"mint"`
}
var Config Configuration

func (Configuration) Load added in v0.1.7

func (c Configuration) Load() error

type ServerConfiguration

type ServerConfiguration struct {
	PrivateKey string `json:"mint_private_key" yaml:"mint_private_key"`
	Host       string `json:"host" yaml:"host"`
	Port       string `json:"port" yaml:"port"`
}

Jump to

Keyboard shortcuts

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