config

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 10 Imported by: 44

Documentation

Overview

Package config contains the configuration required to run a node. while each submodule defines it's own validator adhering to common.Validator they are all stored and validated centrally bt the node here.

Index

Constants

View Source
const AppName = "Sanguine"

AppName is the application name.

View Source
const DefaultCommit = "none"

DefaultCommit is the default commit. Build info will attempt to replace with the current commit if not present.

View Source
const DefaultMetricInterval = time.Duration(1) * time.Minute

DefaultMetricInterval is the metric interval.

View Source
const DefaultVersion = "0.1.0"

DefaultVersion is the application version.

View Source
const VendorName = "synapsecns"

VendorName is the vendor named used for versioning schemes that depend on a vendor name we use the github name for convince.

Variables

View Source
var DefaultDate = time.Now().Format(time.RFC3339)

DefaultDate when not passed in by the compiler.

Functions

func GetConfigDir

func GetConfigDir() (string, error)

GetConfigDir gets the config dir. We create a default file to mark the directory level. if the config dir can not be created, an error is returned.

func GetLogoPath

func GetLogoPath() (_ string, err error)

GetLogoPath fetches the logo path from the config and writes it to the global config if it doesn't exist TODO this should be more generalized to work across static assets when we have more. returns an empty string if not present.

Types

type BuildInfo added in v0.0.10

type BuildInfo struct {
	// contains filtered or unexported fields
}

BuildInfo will contains build info from https://goreleaser.com/cookbooks/using-main.version it is set at compile time by default. If it cannot be, we attempt to derive it at runtime.

func NewBuildInfo added in v0.0.10

func NewBuildInfo(version, commit, name, date string) BuildInfo

NewBuildInfo creates a build info struct from buildtime data it sets sensible defaults.

func (BuildInfo) Commit added in v0.0.10

func (b BuildInfo) Commit() string

Commit of the build.

func (BuildInfo) Date added in v0.0.10

func (b BuildInfo) Date() string

Date the application was built.

func (BuildInfo) MetricInterval added in v0.0.63

func (b BuildInfo) MetricInterval() time.Duration

MetricInterval the interval to record metrics at.

func (BuildInfo) Name added in v0.0.10

func (b BuildInfo) Name() string

Name of the application.

func (BuildInfo) Version added in v0.0.10

func (b BuildInfo) Version() string

Version of the build.

func (BuildInfo) VersionString added in v0.0.10

func (b BuildInfo) VersionString() string

VersionString pretty prints a version string with the info above.

Jump to

Keyboard shortcuts

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