model

package
v0.0.0-...-abe1be5 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderToken  = "token"
	HeaderBearer = "BEARER"
	HeaderAuth   = "Authorization"
)

Request Auth Headers

Variables

This section is empty.

Functions

func ListToJSON

func ListToJSON(s interface{}) string

ListToJSON convert array of structs to JSON

func ToJSON

func ToJSON(s interface{}) string

ToJSON convert struct into string

Types

type Config

type Config struct {
	Storage Storage `json:"storage" yaml:"storage"`
	Web     Web     `json:"web" yaml:"web"`
	GRPC    GRPC    `json:"grpc" yaml:"grpc"`
	Logger  Logger  `json:"logger" yaml:"logger"`
	OpenID  OpenID  `json:"auth" yaml:"auth"`
}

Config is the config format for the main application.

type DBStorage

type DBStorage struct {
	Host     string `json:"host" yaml:"host"`
	Port     int    `json:"port" yaml:"port"`
	User     string `json:"user yaml:"user"`
	Password string `json:"password" yaml:"password"`
	Database string `json:"database" yaml:"database"`
	Key      string `json:"key" yaml:"key"`
}

DBStorage settings for SQL Databse connection

type GRPC

type GRPC struct {
	Addr        string `json:"addr" yaml:"addr"`
	TLSCert     string `json:"tlsCert" yaml:"tlsCert"`
	TLSKey      string `json:"tlsKey" yaml:"tlsKey"`
	TLSClientCA string `json:"tlsClientCA" yaml:"tlsClientCA"`
}

GRPC is the config for the gRPC API.

type Logger

type Logger struct {
	Level  string `json:"level" yaml:"level"`   // Level sets logging level severity.
	Format string `json:"format" yaml:"format"` // Format specifies the format to be used for logging.
}

Logger holds configuration required to customize logging for vreports.

type OpenID

type OpenID struct {
	ID       string `json:"id" yaml:"id"`
	Secret   string `json:"secret" yaml:"secret"`
	Redirect string `json:"redirect" yaml:"redirect"`
	Discover string `json:"discover" yaml:"discover"`
}

OpenID Connector settings

type RedisStorage

type RedisStorage struct {
	Type     string `json:"type" yaml:"type"`
	Master   string `json:"master" yaml:"master"`
	Host     string `json:"host" yaml:"host"`
	Port     int    `json:"port" yaml:"port"`
	Size     int    `json:"size" yaml:"size"`
	Database string `json:"database" yaml:"database"`
	HashKey  string `json:"key" yaml:"key"`
	BlockKey string `json:"blockkey" yaml:"blockkey"`
}

RedisStorage settings to connect to Redis

type Storage

type Storage struct {
	DB      DBStorage    `json:"db" yaml:"db"`
	Session RedisStorage `json:"session" yaml:"session"`
	Cache   RedisStorage `json:"cache" yaml:"cache"`
}

Storage holds app's storage configuration.

type Web

type Web struct {
	HTTP           string   `json:"http" yaml:"http"`
	HTTPS          string   `json:"https" yaml:"https"`
	TLSCert        string   `json:"tlsCert" yaml:"tlsCert"`
	WS             string   `json:"ws" yaml:"ws"`
	TLSKey         string   `json:"tlsKey" yaml:"tlsKey"`
	AllowedOrigins []string `json:"allowedOrigins" yaml:"allowedOrigins"`
}

Web is the config format for the HTTP server.

Jump to

Keyboard shortcuts

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