graph

package
v0.0.0-...-29e199f Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 65 Imported by: 1

Documentation

Overview

Package graph contains the dependency management of the application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeDummyMetrics

func InitializeDummyMetrics() (*dummyMetricsGraph, error)

func InitializeRepositories

func InitializeRepositories(persistenceFramework persistence.Storage) (*repositoriesGraph, error)

Types

type ApplicationGraph

type ApplicationGraph struct {
	Shared GraphShared
	// contains filtered or unexported fields
}

func New

func New(config Config) (*ApplicationGraph, error)

func (*ApplicationGraph) Build

func (graph *ApplicationGraph) Build()

Build builds the application graph

func (*ApplicationGraph) MainServer

func (graph *ApplicationGraph) MainServer() *httpinfra.DefaultHTTPRouter

MainServer obtains the signare main HTTP server

func (*ApplicationGraph) MetricServer

func (graph *ApplicationGraph) MetricServer() *httpinfra.MetricsHTTPRouter

MetricServer obtains the orchestrated metrics server. If the metrics server is nil and there is no error, it means that metrics are not used and therefore the metric server must not be deployed

func (*ApplicationGraph) PersistenceFwConnection

func (graph *ApplicationGraph) PersistenceFwConnection() sql.Connection

func (*ApplicationGraph) RPCMethods

func (graph *ApplicationGraph) RPCMethods() []string

func (*ApplicationGraph) RPCServer

func (graph *ApplicationGraph) RPCServer() rpcinfra.RPCRouter

RPCServer obtains the signare main RPC server

func (*ApplicationGraph) SetInitialSignerAdministrator

func (graph *ApplicationGraph) SetInitialSignerAdministrator(adminID string) (string, error)

func (*ApplicationGraph) UseCases

func (graph *ApplicationGraph) UseCases() *GraphShared

type BuildConfig

type BuildConfig struct {
	// BuildTime timestamp on current build
	BuildTime *string `valid:"optional"`
	// Tag in current commit
	Tag *string `valid:"optional"`
	// CommitHash Git commit hash
	CommitHash *string `valid:"optional"`
}

BuildConfig defines the information of the current signare build

type Config

type Config struct {
	// BuildConfig build configuration
	BuildConfig *BuildConfig `valid:"optional"`
	// Libraries configuration
	Libraries LibrariesConfig `valid:"required"`
	// RequestContextConfig configure the headers in a request
	RequestContextConfig *RequestContextConfig `valid:"optional"`
}

Config of the application

type GraphShared

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

type HSMModules

type HSMModules struct {
	// SoftHSM configuration for SoftHSM.
	SoftHSM *SoftHSMConfig `mapstructure:"softhsm" valid:"optional"`
}

HSMModules configures the hardware security modules.

type LibrariesConfig

type LibrariesConfig struct {
	// Logger configuration
	Logger *LoggerConfig `valid:"optional"`
	// Metrics configuration
	Metrics *MetricsConfig `valid:"optional"`
	// PersistenceFw persistence framework configuration
	PersistenceFw PersistenceFwConfig `valid:"required"`
	// HSMModules provides the configuration of the hardware security modules.
	HSMModules HSMModules `mapstructure:"hsmmodules" valid:"required"`
}

LibrariesConfig configuration of the different libraries used by the signare

type LoggerConfig

type LoggerConfig struct {
	// LogLevel to use for logging. Default level is INFO
	LogLevel *string `valid:"optional"`
}

LoggerConfig configuration of the logger

type MetricsConfig

type MetricsConfig struct {
	// Prometheus configuration
	Prometheus PrometheusConfig `valid:"required"`
}

MetricsConfig configuration of the metric recorder

type PersistenceFwConfig

type PersistenceFwConfig struct {
	// PostgreSQL configuration to connect to a PostgreSQL database
	PostgreSQL *PostgresSQLConfig `valid:"optional"`
	// SQLite configuration to connect to a SQLite database. SQLite must be used just for testing purposes and not in a production environment.
	SQLite *SQLiteConfig `valid:"optional"`
}

PersistenceFwConfig persistence framework configuration

type PostgresSQLClientConfig

type PostgresSQLClientConfig struct {
	// MaxIdleConnections max idle connections for the database/sql handle
	MaxIdleConnections *int `valid:"optional"`
	// MaxOpenConnections max open connections for the database/sql handle
	MaxOpenConnections *int `valid:"optional"`
	// MaxConnectionLifetime max connection lifetime for the database/sql handle
	MaxConnectionLifetime *int `valid:"optional"`
}

PostgresSQLClientConfig configuration for the PostgreSQL client

type PostgresSQLConfig

type PostgresSQLConfig struct {
	// Host of database system
	Host string `valid:"required"`
	// Port of database system. Default value is 5432
	Port *int `valid:"optional"`
	// Scheme of database system. Default value is "postgres"
	Scheme *string `valid:"optional"`
	// Username to use in database system
	Username string `valid:"required"`
	// Password to use with username in database system
	Password string `valid:"required"`
	// SSLMode to use in database system. Default value is "disable", however, it is advised to enable SSL for security reasons
	SSLMode string `valid:"optional"`
	// Database to access to in the database system
	Database string `valid:"required"`
	// SQLClient database client configuration
	SQLClient *PostgresSQLClientConfig `valid:"optional"`
}

PostgresSQLConfig configuration to connect to a PostgreSQL database

type PrometheusConfig

type PrometheusConfig struct {
	// Port where prometheus metrics will be exposed. Default 9780 aligned with not used port from https://github.com/prometheus/prometheus/wiki/Default-port-allocations
	Port *int `valid:"optional"`
	// Path where prometheus is
	Path *string `valid:"optional"`
	// The number of concurrent HTTP requests is limited to MaxRequestsInFlight. See Golang prometheus client for deeper documentation
	MaxRequestsInFlight *int `valid:"optional"`
	// If handling a request takes longer than timeout, the response is 503 ServiceUnavailable and a message. See Golang Prometheus client for deeper documentation
	TimeoutInMillis *int `valid:"optional"`
	// Namespace to prefix metric names. If empty, the default namespace will be applied as defined in package metricsout (defaultNamespace)
	Namespace *string `valid:"optional"`
}

PrometheusConfig Prometheus configuration for the metric recorder

type RequestContextConfig

type RequestContextConfig struct {
	// UserHeaderKey is the header key to define the user of a request
	UserHeaderKey string `mapstructure:"userHeaderKey"`
	// ApplicationHeaderKey is the header key to define the application of a request
	ApplicationHeaderKey string `mapstructure:"applicationHeaderKey"`
}

RequestContextConfig configures the keys in the headers of a request

type SQLiteConfig

type SQLiteConfig struct{}

SQLiteConfig configuration for the SQLite client

type SoftHSMConfig

type SoftHSMConfig struct {
	Library string `mapstructure:"lib" valid:"required"`
}

SoftHSMConfig configures a SoftHSM.

Directories

Path Synopsis
Package upgrade defines the graph with the dependencies needed to execute the db migrations.
Package upgrade defines the graph with the dependencies needed to execute the db migrations.

Jump to

Keyboard shortcuts

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