Documentation
¶
Overview ¶
Copyright 2019-2020 vChain, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2019-2020 vChain, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
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")
)
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 }
Functions ¶
Types ¶
type HistoryHandler ¶
type HistoryHandler interface {
History(w http.ResponseWriter, req *http.Request, pathParams map[string]string)
}
func NewHistoryHandler ¶
func NewHistoryHandler(mux *runtime.ServeMux, client client.ImmuClient) HistoryHandler
type ImmuGwServer ¶
type ImmuGwServer struct {
Options Options
Logger logger.Logger
Pid server.PIDFile
Client schema.ImmuServiceClient
// contains filtered or unexported fields
}
func DefaultServer ¶
func DefaultServer() *ImmuGwServer
func (*ImmuGwServer) Start ¶
func (s *ImmuGwServer) Start() error
func (*ImmuGwServer) Stop ¶
func (s *ImmuGwServer) Stop() error
func (*ImmuGwServer) WithClient ¶
func (c *ImmuGwServer) WithClient(client schema.ImmuServiceClient) *ImmuGwServer
func (*ImmuGwServer) WithLogger ¶
func (c *ImmuGwServer) WithLogger(logger logger.Logger) *ImmuGwServer
func (*ImmuGwServer) WithOptions ¶
func (c *ImmuGwServer) WithOptions(options Options) *ImmuGwServer
type 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
}
func (*MetricsCollection) UpdateAuditResult ¶
func (*MetricsCollection) WithUptimeCounter ¶
func (mc *MetricsCollection) WithUptimeCounter(f func() float64)
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
Detached bool
MTLs bool
MTLsOptions client.MTLsOptions
Config string
Pidfile string
Logfile string
}
func DefaultOptions ¶
func DefaultOptions() 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)
}
func NewSafeReferenceHandler ¶
func NewSafeReferenceHandler(mux *runtime.ServeMux, client client.ImmuClient) SafeReferenceHandler
type SafeZAddHandler ¶
type SafeZAddHandler interface {
SafeZAdd(w http.ResponseWriter, req *http.Request, pathParams map[string]string)
}
func NewSafeZAddHandler ¶
func NewSafeZAddHandler(mux *runtime.ServeMux, client client.ImmuClient) SafeZAddHandler
type SafegetHandler ¶
type SafegetHandler interface {
Safeget(w http.ResponseWriter, req *http.Request, pathParams map[string]string)
}
func NewSafegetHandler ¶
func NewSafegetHandler(mux *runtime.ServeMux, client client.ImmuClient) SafegetHandler
type SafesetHandler ¶
type SafesetHandler interface {
Safeset(w http.ResponseWriter, req *http.Request, pathParams map[string]string)
}
func NewSafesetHandler ¶
func NewSafesetHandler(mux *runtime.ServeMux, client client.ImmuClient) SafesetHandler
type Service ¶
type Service struct {
ImmuGwServer
}
type SetHandler ¶
type SetHandler interface {
Set(w http.ResponseWriter, req *http.Request, pathParams map[string]string)
}
func NewSetHandler ¶
func NewSetHandler(mux *runtime.ServeMux, client client.ImmuClient) SetHandler