Documentation ¶
Index ¶
- Variables
- func RegisterImmuServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, gwclient immugwclient.Client, ...) error
- type HistoryHandler
- type ImmuGw
- type ImmuGwServer
- func (s *ImmuGwServer) Start() error
- func (s *ImmuGwServer) Stop() error
- func (c *ImmuGwServer) WithCliOptions(cliOptions client.Options) ImmuGw
- func (c *ImmuGwServer) WithClient(client schema.ImmuServiceClient) ImmuGw
- func (c *ImmuGwServer) WithLogger(logger logger.Logger) ImmuGw
- func (c *ImmuGwServer) WithOptions(options Options) ImmuGw
- type ImmuGwServerMock
- func (igm *ImmuGwServerMock) Start() error
- func (igm *ImmuGwServerMock) Stop() error
- func (igm *ImmuGwServerMock) WithCliOptions(options client.Options) ImmuGw
- func (igm *ImmuGwServerMock) WithClient(client schema.ImmuServiceClient) ImmuGw
- func (igm *ImmuGwServerMock) WithLogger(logger logger.Logger) ImmuGw
- func (igm *ImmuGwServerMock) WithOptions(options Options) ImmuGw
- 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) WithAuditSignature(auditSignature 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
- func (o Options) WithTokenService(tokenService tokenservice.TokenService) Options
- type Runtime
- type SafeReferenceHandler
- type Service
- type SetHandler
- type UseDatabaseHandler
- type VerifiedGetHandler
- type VerifiedSQLGetHandler
- type VerifiedSetHandler
- type VerifiedTxByIdHandler
- type VerifiedZaddHandler
Constants ¶
This section is empty.
Variables ¶
var ( ErrKeyNotFound = status.Error(codes.Unknown, "key not found") ErrCorruptedData = status.Error(codes.Aborted, "data is corrupted") // codes.Aborted is translated in StatusConflict 409 http error )
sdk errors
var ( ErrIllegalArgument = errors.New("illegal arguments: empty key") ErrKeyNotFoundTBTree = errors.New("tbtree: key not found") )
wrap server errors which are not constants in immudb
var ( StatusErrKeyNotFound = status.Error(codes.NotFound, "") StatusDatabaseNotFound = status.Error(codes.NotFound, "") )
var (
ErrInvalidItemProof = errors.New("proof does not match the given item")
)
ErrInvalidItemProof ...
Functions ¶
func RegisterImmuServiceHandlerClient ¶ added in v1.3.0
func RegisterImmuServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, gwclient immugwclient.Client, defaultClient schema.ImmuServiceClient) error
RegisterImmuServiceHandlerClient registers the http handlers for service ImmuService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "immugwclient.Client". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "immugwclient.Client" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "immugwclient.Client" to call the correct interceptors.
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 immugwclient.Client, rt Runtime, json json.JSON) HistoryHandler
NewHistoryHandler ...
type ImmuGw ¶
type ImmuGw interface { Start() error Stop() error WithClient(schema.ImmuServiceClient) ImmuGw WithLogger(logger.Logger) ImmuGw WithOptions(Options) ImmuGw WithCliOptions(client.Options) ImmuGw }
ImmuGw ...
type ImmuGwServer ¶
type ImmuGwServer struct { Options Options CliOptions client.Options Logger logger.Logger Pid server.PIDFile Client schema.ImmuServiceClient MetricServer *metricServer // 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) WithCliOptions ¶
func (c *ImmuGwServer) WithCliOptions(cliOptions client.Options) ImmuGw
WithCliOptions ...
func (*ImmuGwServer) WithClient ¶
func (c *ImmuGwServer) WithClient(client schema.ImmuServiceClient) ImmuGw
WithClient ...
func (*ImmuGwServer) WithLogger ¶
func (c *ImmuGwServer) WithLogger(logger logger.Logger) ImmuGw
WithLogger ...
func (*ImmuGwServer) WithOptions ¶
func (c *ImmuGwServer) WithOptions(options Options) ImmuGw
WithOptions ...
type ImmuGwServerMock ¶
type ImmuGwServerMock struct { StartF func() error StopF func() error WithClientF func(schema.ImmuServiceClient) ImmuGw WithLoggerF func(logger.Logger) ImmuGw WithOptionsF func(Options) ImmuGw WithCliOptionsF func(client.Options) ImmuGw }
ImmuGwServerMock ...
func (*ImmuGwServerMock) WithCliOptions ¶
func (igm *ImmuGwServerMock) WithCliOptions(options client.Options) ImmuGw
WithCliOptions ...
func (*ImmuGwServerMock) WithClient ¶
func (igm *ImmuGwServerMock) WithClient(client schema.ImmuServiceClient) ImmuGw
WithClient ...
func (*ImmuGwServerMock) WithLogger ¶
func (igm *ImmuGwServerMock) WithLogger(logger logger.Logger) ImmuGw
WithLogger ...
func (*ImmuGwServerMock) WithOptions ¶
func (igm *ImmuGwServerMock) WithOptions(options Options) ImmuGw
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.ImmutableState, currRoot *schema.ImmutableState, )
UpdateAuditResult updates the metrics related to audit result
func (MetricsCollection) WithUptimeCounter ¶
func (mc MetricsCollection) WithUptimeCounter(reg *prometheus.Registry, 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:"-"` AuditSignature string Detached bool MTLs bool MTLsOptions client.MTLsOptions Config string Pidfile string Logfile string TokenService tokenservice.TokenService }
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) WithAuditSignature ¶
WithAuditSignature sets AuditSignature
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
func (Options) WithTokenService ¶ added in v1.2.0
func (o Options) WithTokenService(tokenService tokenservice.TokenService) Options
type Runtime ¶
type Runtime interface { AnnotateContext(context.Context, *runtime.ServeMux, *http.Request) (context.Context, error) Bytes(string) ([]byte, error) HTTPError(context.Context, *runtime.ServeMux, runtime.Marshaler, http.ResponseWriter, *http.Request, error) MarshalerForRequest(*runtime.ServeMux, *http.Request) (runtime.Marshaler, runtime.Marshaler) NewServerMetadataContext(context.Context, runtime.ServerMetadata) context.Context }
Runtime ...
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 immugwclient.Client, rt Runtime, json json.JSON) SafeReferenceHandler
NewSafeReferenceHandler ...
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 immugwclient.Client, rt Runtime, json json.JSON) SetHandler
NewSetHandler ...
type UseDatabaseHandler ¶
type UseDatabaseHandler interface {
UseDatabase(w http.ResponseWriter, req *http.Request, pathParams map[string]string)
}
UseDatabaseHandler ...
func NewUseDatabaseHandler ¶
func NewUseDatabaseHandler(mux *runtime.ServeMux, client immugwclient.Client, rt Runtime, json json.JSON) UseDatabaseHandler
NewUseDatabaseHandler ...
type VerifiedGetHandler ¶ added in v1.0.5
type VerifiedGetHandler interface {
VerifiedGet(w http.ResponseWriter, req *http.Request, pathParams map[string]string)
}
VerifiedGetHandler ...
func NewVerifiedGetHandler ¶ added in v1.0.5
func NewVerifiedGetHandler(mux *runtime.ServeMux, client immugwclient.Client, rt Runtime, json json.JSON) VerifiedGetHandler
NewVerifiedGetHandler ...
type VerifiedSQLGetHandler ¶ added in v1.1.0
type VerifiedSQLGetHandler interface {
VerifiedSQLGetHandler(w http.ResponseWriter, req *http.Request, pathParams map[string]string)
}
VerifiedGetHandler ...
func NewVerifiedSQLGetHandler ¶ added in v1.1.0
func NewVerifiedSQLGetHandler(mux *runtime.ServeMux, client immugwclient.Client, rt Runtime, json json.JSON) VerifiedSQLGetHandler
NewVerifiedSQLGetHandler ...
type VerifiedSetHandler ¶ added in v1.0.5
type VerifiedSetHandler interface {
VerifiedSet(w http.ResponseWriter, req *http.Request, pathParams map[string]string)
}
VerifiedSetHandler ...
func NewVerifiedSetHandler ¶ added in v1.0.5
func NewVerifiedSetHandler(mux *runtime.ServeMux, client immugwclient.Client, rt Runtime, json json.JSON) VerifiedSetHandler
NewVerifiedSetHandler ...
type VerifiedTxByIdHandler ¶ added in v1.0.5
type VerifiedTxByIdHandler interface {
VerifiedTxById(w http.ResponseWriter, req *http.Request, pathParams map[string]string)
}
VerifiedTxByIdHandler ...
func NewVerifiedTxByIdHandler ¶ added in v1.0.5
func NewVerifiedTxByIdHandler(mux *runtime.ServeMux, client immugwclient.Client, rt Runtime, json json.JSON) VerifiedTxByIdHandler
NewVerifiedTxById ...
type VerifiedZaddHandler ¶ added in v1.0.5
type VerifiedZaddHandler interface {
VerifiedZadd(w http.ResponseWriter, req *http.Request, pathParams map[string]string)
}
VerifiedZaddHandler ...
func NewVerifiedZaddHandler ¶ added in v1.0.5
func NewVerifiedZaddHandler(mux *runtime.ServeMux, client immugwclient.Client, rt Runtime, json json.JSON) VerifiedZaddHandler
NewVerifiedZaddHandler ...
Source Files ¶
- default_handlers.go
- errors.go
- history_handler.go
- immugw_server_mock.go
- metrics.go
- options.go
- runtime.go
- server.go
- service.go
- set_handler.go
- types.go
- usedatabase_handler.go
- verifiedGet_handler.go
- verifiedSQLGet_handler.go
- verifiedSetReference_handler.go
- verifiedSet_handler.go
- verifiedTxById_handler.go
- verifiedZadd_handler.go