Documentation
¶
Index ¶
- Variables
- func StartMetrics(addr string, l logger.Logger, uptimeCounter func() float64) *http.Server
- type HistoryHandler
- type ImmuGwServer
- type LastAuditResult
- type MetricsCollection
- type Options
- func (o Options) Bind() string
- func (o Options) MetricsBind() string
- func (o Options) String() string
- func (o Options) WithAddress(address string) Options
- func (o Options) WithAudit(audit bool) Options
- func (o Options) WithAuditInterval(auditInterval time.Duration) Options
- func (o Options) WithAuditPassword(auditPassword string) Options
- func (o Options) WithAuditUsername(auditUsername string) Options
- func (o Options) WithConfig(config string) Options
- func (o Options) WithDetached(detached bool) Options
- func (o Options) WithDir(dir string) Options
- func (o Options) WithImmudbAddress(immudbAddress string) Options
- func (o Options) WithImmudbPort(immudbPort int) Options
- func (o Options) WithLogfile(logfile string) Options
- func (o Options) WithMTLs(MTLs bool) Options
- func (o Options) WithMTLsOptions(MTLsOptions client.MTLsOptions) Options
- func (o Options) WithPidfile(pidfile string) Options
- func (o Options) WithPort(port int) Options
- type SafeReferenceHandler
- type SafeZAddHandler
- type SafegetHandler
- type SafesetHandler
- type Service
- type SetHandler
Constants ¶
This section is empty.
Variables ¶
var (
InvalidItemProof = errors.New("proof does not match the given item")
)
InvalidItemProof ...
var Metrics = MetricsCollection{ AuditResultPerServer: newAuditGaugeVec( "audit_result_per_server", "Latest audit result (1 = ok, 0 = tampered).", ), AuditPrevRootPerServer: newAuditGaugeVec( "audit_prev_root_per_server", "Previous root index used for the latest audit.", ), AuditCurrRootPerServer: newAuditGaugeVec( "audit_curr_root_per_server", "Current root index used for the latest audit.", ), AuditRunAtPerServer: newAuditGaugeVec( "audit_run_at_per_server", "Timestamp in unix seconds at which latest audit run.", ), // contains filtered or unexported fields }
Metrics gateway metrics collection
Functions ¶
Types ¶
type HistoryHandler ¶
type HistoryHandler interface {
History(w http.ResponseWriter, req *http.Request, pathParams map[string]string)
}
HistoryHandler ...
func NewHistoryHandler ¶
func NewHistoryHandler(mux *runtime.ServeMux, client client.ImmuClient) HistoryHandler
NewHistoryHandler ...
type ImmuGwServer ¶
type ImmuGwServer struct {
Options Options
Logger logger.Logger
Pid server.PIDFile
Client schema.ImmuServiceClient
// contains filtered or unexported fields
}
ImmuGwServer ...
func DefaultServer ¶
func DefaultServer() *ImmuGwServer
DefaultServer returns a default immudb gateway server
func (*ImmuGwServer) Start ¶
func (s *ImmuGwServer) Start() error
Start starts the immudb gateway server
func (*ImmuGwServer) Stop ¶
func (s *ImmuGwServer) Stop() error
Stop stops the immudb gateway server
func (*ImmuGwServer) WithClient ¶
func (c *ImmuGwServer) WithClient(client schema.ImmuServiceClient) *ImmuGwServer
WithClient ...
func (*ImmuGwServer) WithLogger ¶
func (c *ImmuGwServer) WithLogger(logger logger.Logger) *ImmuGwServer
WithLogger ...
func (*ImmuGwServer) WithOptions ¶
func (c *ImmuGwServer) WithOptions(options Options) *ImmuGwServer
WithOptions ...
type LastAuditResult ¶
type LastAuditResult struct {
ServerID string
ServerAddress string
HasRunConsistencyCheck bool
HasError bool
ConsistencyCheckResult bool
PreviousRootIndex float64
PreviousRoot string
CurrentRootIndex float64
CurrentRoot string
RunAt time.Time
sync.RWMutex
}
LastAuditResult ...
type MetricsCollection ¶
type MetricsCollection struct {
AuditResultPerServer *prometheus.GaugeVec
AuditPrevRootPerServer *prometheus.GaugeVec
AuditCurrRootPerServer *prometheus.GaugeVec
AuditRunAtPerServer *prometheus.GaugeVec
UptimeCounter prometheus.CounterFunc
// contains filtered or unexported fields
}
MetricsCollection the gateway metrics collection
func (*MetricsCollection) UpdateAuditResult ¶
func (mc *MetricsCollection) UpdateAuditResult( serverID string, serverAddress string, checked bool, withError bool, result bool, prevRoot *schema.Root, currRoot *schema.Root, )
UpdateAuditResult updates the metrics related to audit result
func (*MetricsCollection) WithUptimeCounter ¶
func (mc *MetricsCollection) WithUptimeCounter(f func() float64)
WithUptimeCounter ...
type Options ¶
type Options struct {
Dir string
Address string
Port int
MetricsPort int
ImmudbAddress string
ImmudbPort int
Audit bool
AuditInterval time.Duration
AuditUsername string
AuditPassword string `json:"-"`
Detached bool
MTLs bool
MTLsOptions client.MTLsOptions
Config string
Pidfile string
Logfile string
}
Options immudb gateway server options
func (Options) MetricsBind ¶
MetricsBind return metrics bind address
func (Options) WithAddress ¶
WithAddress sets address
func (Options) WithAuditInterval ¶
WithAuditInterval sets AuditInterval
func (Options) WithAuditPassword ¶
WithAuditPassword sets AuditPassword
func (Options) WithAuditUsername ¶
WithAuditUsername sets AuditUsername
func (Options) WithConfig ¶
WithConfig sets config
func (Options) WithDetached ¶
WithDetached sets immugw to be run in background
func (Options) WithImmudbAddress ¶
WithImmudbAddress sets immudbAddress
func (Options) WithImmudbPort ¶
WithImmudbPort sets immudbPort
func (Options) WithLogfile ¶
WithLogfile sets logfile
func (Options) WithMTLsOptions ¶
func (o Options) WithMTLsOptions(MTLsOptions client.MTLsOptions) Options
WithMTLsOptions sets MTLsOptions
func (Options) WithPidfile ¶
WithPidfile sets pidfile
type SafeReferenceHandler ¶
type SafeReferenceHandler interface {
SafeReference(w http.ResponseWriter, req *http.Request, pathParams map[string]string)
}
SafeReferenceHandler ...
func NewSafeReferenceHandler ¶
func NewSafeReferenceHandler(mux *runtime.ServeMux, client client.ImmuClient) SafeReferenceHandler
NewSafeReferenceHandler ...
type SafeZAddHandler ¶
type SafeZAddHandler interface {
SafeZAdd(w http.ResponseWriter, req *http.Request, pathParams map[string]string)
}
SafeZAddHandler ...
func NewSafeZAddHandler ¶
func NewSafeZAddHandler(mux *runtime.ServeMux, client client.ImmuClient) SafeZAddHandler
NewSafeZAddHandler ...
type SafegetHandler ¶
type SafegetHandler interface {
Safeget(w http.ResponseWriter, req *http.Request, pathParams map[string]string)
}
SafegetHandler ...
func NewSafegetHandler ¶
func NewSafegetHandler(mux *runtime.ServeMux, client client.ImmuClient) SafegetHandler
NewSafegetHandler ...
type SafesetHandler ¶
type SafesetHandler interface {
Safeset(w http.ResponseWriter, req *http.Request, pathParams map[string]string)
}
SafesetHandler ...
func NewSafesetHandler ¶
func NewSafesetHandler(mux *runtime.ServeMux, client client.ImmuClient) SafesetHandler
NewSafesetHandler ...
type SetHandler ¶
type SetHandler interface {
Set(w http.ResponseWriter, req *http.Request, pathParams map[string]string)
}
SetHandler ...
func NewSetHandler ¶
func NewSetHandler(mux *runtime.ServeMux, client client.ImmuClient) SetHandler
NewSetHandler ...