pg

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: BSD-2-Clause Imports: 16 Imported by: 0

Documentation

Overview

Package pg implements PostgreSQL-like storage interface. This implementation does not use ORM and relies on database structure and queries provided in configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ConnectionString   string `cfg:"connection_string"`
	PingQuery          string `cfg:"ping_query"`
	Peer               peerQueryConf
	Announce           announceQueryConf
	Downloads          downloadQueryConf
	Data               dataQueryConf
	GCQuery            string `cfg:"gc_query"`
	InfoHashCountQuery string `cfg:"info_hash_count_query"`
}

Config holds the configuration of a redis PeerStorage.

func (Config) Validate

func (cfg Config) Validate() (Config, error)

Validate sanity checks values set in a config and returns a new config with default values replacing anything that is invalid.

This function warns to the logger when a value is changed.

Jump to

Keyboard shortcuts

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