configuration

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: ISC Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Argon2Config

type Argon2Config struct {
	Memory      uint32 `default:"131072"`
	Iterations  uint32 `default:"4"`
	Parallelism uint8  `default:"4"`
	SaltLength  uint32 `default:"16"`
	KeyLength   uint32 `default:"32"`
}

Argon2Config holds the parameters used for creating hashes with Argon2.

type Configuration

type Configuration struct {
	Debug bool `default:"false"`
	HTTP  struct {
		ListenAddress string `default:""`
		Port          int    `default:"8080"`
	}
	Database struct {
		Dialect    string `default:"sqlite3"`
		Connection string `default:"pushbits.db"`
	}
	Admin struct {
		Name     string `default:"admin"`
		Password string `default:"admin"`
		MatrixID string `required:"true"`
	}
	Matrix   Matrix
	Security struct {
		CheckHIBP bool `default:"false"`
	}
	Crypto     CryptoConfig
	Formatting Formatting
}

Configuration holds values that can be configured by the user.

func Get

func Get() *Configuration

Get returns the configuration extracted from env variables or config file.

type CryptoConfig

type CryptoConfig struct {
	Argon2 Argon2Config
}

CryptoConfig holds the parameters used for creating hashes.

type Formatting

type Formatting struct {
	ColoredTitle bool `default:"false"`
}

Formatting holds additional parameters used for formatting messages

type Matrix

type Matrix struct {
	Homeserver string `default:"https://matrix.org"`
	Username   string `required:"true"`
	Password   string `required:"true"`
}

Matrix holds credentials for a matrix account

Jump to

Keyboard shortcuts

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