baasd

package
v0.0.0-...-bd0efcb Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//DBEnginePostgreSQL = "postgres"
	DBEngineBolt = "bolt"

	DefaultMaxChunkSize      = 10000000 // 10MB
	DefaultTransformFileSize = 50000000 // 50MB
	DefaultMaxUploadFileSize = 50000000 // 50MB

	DefaultChunkUploadDir = "./data/chunks"
	DefaultFullFileDir    = "./data/files"
	DefaultTempFileDir    = "./data/temp"
	DefaultHTTPPort       = 4200

	//DefaultPostgreDatabase = "mahi"
	//DefaultPostgreUser     = "mahi"
	DefaultPostgrePassword = ""
	DefaultPostgreHost     = "localhost"
	DefaultPostgrePort     = 5432

	DefaultBoltDir = "./data/baas.db"
)

Variables

View Source
var DefaultPostgreMaxConns = runtime.NumCPU() * 10

Functions

This section is empty.

Types

type BlockChain

type BlockChain struct {
	Connection string `toml:"connection"`
	GasPrice   int    `toml:"gas_price"`
	APIServer  string `toml:"api_server"`
	NID        string `toml:"network_id"`
}

type Bolt

type Bolt struct {
	Dir string `toml:"dir"`
}

type Config

type Config struct {
	Init       bool
	DbEngine   string     `toml:"db_engine"`
	Upload     Upload     `toml:"upload"`
	PostgreSQL PostgreSQL `toml:"postgresql"`
	Bolt       Bolt       `toml:"bolt"`
	Security   Security   `toml:"security"`
	HTTP       HTTP       `toml:"http"`
	IPFS       IPFS       `toml:"ipfs"`
	Blockchain BlockChain `toml:"blockchain"`
}

func GetSystemConfig

func GetSystemConfig() *Config

Return system wide config

func (*Config) InitConfig

func (c *Config) InitConfig() error

func (*Config) Validate

func (c *Config) Validate() error

type HTTP

type HTTP struct {
	HTTPS       bool   `toml:"https"`
	Port        int    `toml:"port"`
	SSLCertPath string `toml:"ssl_cert_path"`
	SSLKeyPath  string `toml:"ssl_key_path"`
}

type IPFS

type IPFS struct {
	API     string `toml:"api"`
	Service string `toml:"service"`
}

type PostgreSQL

type PostgreSQL struct {
	Database string `toml:"database"`
	Host     string `toml:"host"`
	Port     int    `toml:"port"`
	User     string `toml:"user"`
	Password string `toml:"password"`
	MaxConns int    `toml:"max_conns"`
}

type Security

type Security struct {
	AESKey      string `toml:"aes_key"`
	GMKey       string `toml:"gm_key"`
	GMIV        string `toml:"gm_iv"`
	AuthToken   string `toml:"auth_token"`
	HTTPS       bool   `toml:"https"`
	Application bool   `toml:"application"`
}

type Upload

type Upload struct {
	ChunkUploadDir       string `toml:"chunk_upload_dir"`
	FullFileDir          string `toml:"full_file_dir"`
	MaxChunkSize         int64  `toml:"max_chunk_size"`
	MaxUploadFileSize    int64  `toml:"max_file_size_upload"`
	MaxTransformFileSize int64  `toml:"max_transform_file_size"`
}

Jump to

Keyboard shortcuts

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