Documentation ¶
Overview ¶
Copyright 2021 CodeNotary, Inc. All rights reserved.
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 2021 CodeNotary, Inc. All rights reserved.
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 2021 CodeNotary, Inc. All rights reserved.
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 ¶
- Constants
- Variables
- func DefaultStoreOptions() *store.Options
- func ErrorMapper(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
- func ErrorMapperStream(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, ...) error
- func IsAllowedDbName(dbName string) error
- func NewStateSigner(signer signer.Signer) *stateSigner
- func NewUUIDContext(id xid.ID) uuidContext
- func StartMetrics(addr string, l logger.Logger, uptimeCounter func() float64, ...) *http.Server
- func StartWebServer(addr string, tlsConfig *tls.Config, s schema.ImmuServiceServer, ...) (*http.Server, error)
- type ImmuServer
- func (s *ImmuServer) ChangePassword(ctx context.Context, r *schema.ChangePasswordRequest) (*empty.Empty, error)
- func (s *ImmuServer) ChangePermission(ctx context.Context, r *schema.ChangePermissionRequest) (*empty.Empty, error)
- func (s *ImmuServer) CleanIndex(ctx context.Context, req *empty.Empty) (*empty.Empty, error)
- func (s *ImmuServer) CloseDatabases() error
- func (s *ImmuServer) Count(ctx context.Context, prefix *schema.KeyPrefix) (*schema.EntryCount, error)
- func (s *ImmuServer) CountAll(ctx context.Context, e *empty.Empty) (*schema.EntryCount, error)
- func (s *ImmuServer) CreateDatabase(ctx context.Context, newdb *schema.Database) (*empty.Empty, error)
- func (s *ImmuServer) CreateUser(ctx context.Context, r *schema.CreateUserRequest) (*empty.Empty, error)
- func (s *ImmuServer) CurrentState(ctx context.Context, e *empty.Empty) (*schema.ImmutableState, error)
- func (s *ImmuServer) DatabaseList(ctx context.Context, req *empty.Empty) (*schema.DatabaseListResponse, error)
- func (s *ImmuServer) DescribeTable(ctx context.Context, req *schema.Table) (*schema.SQLQueryResult, error)
- func (s *ImmuServer) ExecAll(ctx context.Context, req *schema.ExecAllRequest) (*schema.TxMetadata, error)
- func (s *ImmuServer) Get(ctx context.Context, req *schema.KeyRequest) (*schema.Entry, error)
- func (s *ImmuServer) GetAll(ctx context.Context, req *schema.KeyListRequest) (*schema.Entries, error)
- func (s *ImmuServer) Health(ctx context.Context, e *empty.Empty) (*schema.HealthResponse, error)
- func (s *ImmuServer) History(ctx context.Context, req *schema.HistoryRequest) (*schema.Entries, error)
- func (s *ImmuServer) Initialize() error
- func (s *ImmuServer) ListTables(ctx context.Context, _ *empty.Empty) (*schema.SQLQueryResult, error)
- func (s *ImmuServer) ListUsers(ctx context.Context, req *empty.Empty) (*schema.UserList, error)
- func (s *ImmuServer) Login(ctx context.Context, r *schema.LoginRequest) (*schema.LoginResponse, error)
- func (s *ImmuServer) Logout(ctx context.Context, r *empty.Empty) (*empty.Empty, error)
- func (s *ImmuServer) SQLExec(ctx context.Context, req *schema.SQLExecRequest) (*schema.SQLExecResult, error)
- func (s *ImmuServer) SQLQuery(ctx context.Context, req *schema.SQLQueryRequest) (*schema.SQLQueryResult, error)
- func (s *ImmuServer) Scan(ctx context.Context, req *schema.ScanRequest) (*schema.Entries, error)
- func (s *ImmuServer) Set(ctx context.Context, kv *schema.SetRequest) (*schema.TxMetadata, error)
- func (s *ImmuServer) SetActiveUser(ctx context.Context, r *schema.SetActiveUserRequest) (*empty.Empty, error)
- func (s *ImmuServer) SetReference(ctx context.Context, req *schema.ReferenceRequest) (*schema.TxMetadata, error)
- func (s *ImmuServer) Start() (err error)
- func (s *ImmuServer) Stop() error
- func (s *ImmuServer) StreamExecAll(str schema.ImmuService_StreamExecAllServer) error
- func (s *ImmuServer) StreamGet(kr *schema.KeyRequest, str schema.ImmuService_StreamGetServer) error
- func (s *ImmuServer) StreamHistory(request *schema.HistoryRequest, server schema.ImmuService_StreamHistoryServer) error
- func (s *ImmuServer) StreamScan(req *schema.ScanRequest, str schema.ImmuService_StreamScanServer) error
- func (s *ImmuServer) StreamSet(str schema.ImmuService_StreamSetServer) error
- func (s *ImmuServer) StreamVerifiableGet(req *schema.VerifiableGetRequest, ...) error
- func (s *ImmuServer) StreamVerifiableSet(str schema.ImmuService_StreamVerifiableSetServer) error
- func (s *ImmuServer) StreamZScan(request *schema.ZScanRequest, server schema.ImmuService_StreamZScanServer) error
- func (s *ImmuServer) TxById(ctx context.Context, req *schema.TxRequest) (*schema.Tx, error)
- func (s *ImmuServer) TxScan(ctx context.Context, req *schema.TxScanRequest) (*schema.TxList, error)
- func (s *ImmuServer) UpdateAuthConfig(ctx context.Context, req *schema.AuthConfig) (*empty.Empty, error)
- func (s *ImmuServer) UpdateMTLSConfig(ctx context.Context, req *schema.MTLSConfig) (*empty.Empty, error)
- func (s *ImmuServer) UseDatabase(ctx context.Context, db *schema.Database) (*schema.UseDatabaseReply, error)
- func (s *ImmuServer) UseSnapshot(ctx context.Context, req *schema.UseSnapshotRequest) (*empty.Empty, error)
- func (s *ImmuServer) VerifiableGet(ctx context.Context, req *schema.VerifiableGetRequest) (*schema.VerifiableEntry, error)
- func (s *ImmuServer) VerifiableSQLGet(ctx context.Context, req *schema.VerifiableSQLGetRequest) (*schema.VerifiableSQLEntry, error)
- func (s *ImmuServer) VerifiableSet(ctx context.Context, req *schema.VerifiableSetRequest) (*schema.VerifiableTx, error)
- func (s *ImmuServer) VerifiableSetReference(ctx context.Context, req *schema.VerifiableReferenceRequest) (*schema.VerifiableTx, error)
- func (s *ImmuServer) VerifiableTxById(ctx context.Context, req *schema.VerifiableTxRequest) (*schema.VerifiableTx, error)
- func (s *ImmuServer) VerifiableZAdd(ctx context.Context, req *schema.VerifiableZAddRequest) (*schema.VerifiableTx, error)
- func (s *ImmuServer) WithLogger(logger logger.Logger) ImmuServerIf
- func (s *ImmuServer) WithOptions(options *Options) ImmuServerIf
- func (s *ImmuServer) WithPgsqlServer(psrv pgsqlsrv.Server) ImmuServerIf
- func (s *ImmuServer) WithStateSigner(stateSigner StateSigner) ImmuServerIf
- func (s *ImmuServer) WithStreamServiceFactory(ssf stream.ServiceFactory) ImmuServerIf
- func (s *ImmuServer) ZAdd(ctx context.Context, req *schema.ZAddRequest) (*schema.TxMetadata, error)
- func (s *ImmuServer) ZScan(ctx context.Context, req *schema.ZScanRequest) (*schema.ZEntries, error)
- type ImmuServerIf
- type MetricsCollection
- func (mc *MetricsCollection) UpdateClientMetrics(ctx context.Context)
- func (mc *MetricsCollection) UpdateDBMetrics()
- func (mc *MetricsCollection) WithComputeDBEntries(f func() map[string]float64)
- func (mc *MetricsCollection) WithComputeDBSizes(f func() map[string]float64)
- func (mc *MetricsCollection) WithUptimeCounter(f func() float64)
- type Options
- func (o *Options) Bind() string
- func (o *Options) GetAuth() bool
- func (o *Options) GetDefaultDbName() string
- func (o *Options) GetMaintenance() bool
- func (o *Options) GetSystemAdminDbName() string
- func (o *Options) MetricsBind() string
- func (o *Options) String() string
- func (o *Options) WebBind() string
- func (o *Options) WithAddress(address string) *Options
- func (o *Options) WithAdminPassword(adminPassword string) *Options
- func (o *Options) WithAuth(authEnabled bool) *Options
- func (o *Options) WithConfig(config string) *Options
- func (o *Options) WithDetached(detached bool) *Options
- func (o *Options) WithDevMode(devMode bool) *Options
- func (o *Options) WithDir(dir string) *Options
- func (o *Options) WithListener(lis net.Listener) *Options
- func (o *Options) WithLogfile(logfile string) *Options
- func (o *Options) WithMaintenance(m bool) *Options
- func (o *Options) WithMaxRecvMsgSize(maxRecvMsgSize int) *Options
- func (o *Options) WithMetricsServer(metricsServer bool) *Options
- func (o *Options) WithNetwork(network string) *Options
- func (o *Options) WithNoHistograms(noHistograms bool) *Options
- func (o *Options) WithPgsqlServer(enable bool) *Options
- func (o *Options) WithPgsqlServerPort(port int) *Options
- func (o *Options) WithPidfile(pidfile string) *Options
- func (o *Options) WithPort(port int) *Options
- func (o *Options) WithSigningKey(signingKey string) *Options
- func (o *Options) WithStoreOptions(storeOpts *store.Options) *Options
- func (o *Options) WithStreamChunkSize(streamChunkSize int) *Options
- func (o *Options) WithTLS(tls *tls.Config) *Options
- func (o *Options) WithTokenExpiryTime(tokenExpiryTimeMin int) *Options
- func (o *Options) WithWebServer(webServer bool) *Options
- func (o *Options) WithWebServerPort(port int) *Options
- type PIDFile
- type Service
- type StateSigner
- type UUIDContext
- type WrappedServerStream
Constants ¶
const DefaultDbIndex = 0
DefaultDbIndex systemdb should always be in index 0
const DefaultdbName = "defaultdb"
const IDENTIFIER_FNAME = "immudb.identifier"
IDENTIFIER_FNAME ...
const ( //KeyPrefixUser All user keys in the key/value store are prefixed by this keys to distinguish them from keys that have other purposes KeyPrefixUser = iota + 1 )
const SERVER_UUID_HEADER = "immudb-uuid"
SERVER_UUID_HEADER ...
const SystemdbName = "systemdb"
Variables ¶
var ( ErrIllegalArguments = status.Error(codes.InvalidArgument, database.ErrIllegalArguments.Error()) ErrIllegalState = status.Error(codes.InvalidArgument, database.ErrIllegalState.Error()) ErrEmptyAdminPassword = status.Error(codes.InvalidArgument, "Admin password cannot be empty") )
var Metrics = MetricsCollection{ RPCsPerClientCounters: promauto.NewCounterVec( prometheus.CounterOpts{ Namespace: metricsNamespace, Name: "number_of_rpcs_per_client", Help: "Number of handled RPCs per client.", }, []string{"ip"}, ), DBSizeGauges: promauto.NewGaugeVec( prometheus.GaugeOpts{ Namespace: metricsNamespace, Name: "db_size_bytes", Help: "Database size in bytes.", }, []string{"db"}, ), DBEntriesGauges: promauto.NewGaugeVec( prometheus.GaugeOpts{ Namespace: metricsNamespace, Name: "number_of_stored_entries", Help: "Number of key-value entries currently stored by the database.", }, []string{"db"}, ), LastMessageAtPerClientGauges: promauto.NewGaugeVec( prometheus.GaugeOpts{ Namespace: metricsNamespace, Name: "clients_last_message_at_unix_seconds", Help: "Timestamp at which clients have sent their most recent message.", }, []string{"ip"}, ), }
Metrics immudb Prometheus metrics collection
Functions ¶
func DefaultStoreOptions ¶ added in v0.9.1
func ErrorMapper ¶ added in v0.9.2
func ErrorMapper(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
ErrorMapper map standard errors in gRPC errors
func ErrorMapperStream ¶ added in v0.9.2
func ErrorMapperStream(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error
ErrorMapperStream map standard errors in gRPC errors
func IsAllowedDbName ¶ added in v0.7.0
IsAllowedDbName checks if the provided database name meets the requirements
func NewStateSigner ¶ added in v0.9.0
func NewUUIDContext ¶ added in v0.9.0
NewUUIDContext return a new UUId context servive
func StartMetrics ¶
func StartMetrics( addr string, l logger.Logger, uptimeCounter func() float64, computeDBSizes func() map[string]float64, computeDBEntries func() map[string]float64, ) *http.Server
StartMetrics listens and servers the HTTP metrics server in a new goroutine. The server is then returned and can be stopped using Close().
Types ¶
type ImmuServer ¶
type ImmuServer struct { OS immuos.OS Logger logger.Logger Options *Options GrpcServer *grpc.Server UUID xid.ID Pid PIDFile StateSigner StateSigner StreamServiceFactory stream.ServiceFactory PgsqlSrv pgsqlsrv.Server // contains filtered or unexported fields }
ImmuServer ...
func (*ImmuServer) ChangePassword ¶
func (s *ImmuServer) ChangePassword(ctx context.Context, r *schema.ChangePasswordRequest) (*empty.Empty, error)
ChangePassword ...
func (*ImmuServer) ChangePermission ¶ added in v0.7.0
func (s *ImmuServer) ChangePermission(ctx context.Context, r *schema.ChangePermissionRequest) (*empty.Empty, error)
ChangePermission grant or revoke user permissions on databases
func (*ImmuServer) CleanIndex ¶ added in v0.9.1
func (*ImmuServer) CloseDatabases ¶ added in v0.7.0
func (s *ImmuServer) CloseDatabases() error
CloseDatabases closes all opened databases including the consinstency checker
func (*ImmuServer) Count ¶
func (s *ImmuServer) Count(ctx context.Context, prefix *schema.KeyPrefix) (*schema.EntryCount, error)
Count ...
func (*ImmuServer) CountAll ¶ added in v0.8.1
func (s *ImmuServer) CountAll(ctx context.Context, e *empty.Empty) (*schema.EntryCount, error)
CountAll ...
func (*ImmuServer) CreateDatabase ¶ added in v0.7.0
func (s *ImmuServer) CreateDatabase(ctx context.Context, newdb *schema.Database) (*empty.Empty, error)
CreateDatabase Create a new database instance
func (*ImmuServer) CreateUser ¶
func (s *ImmuServer) CreateUser(ctx context.Context, r *schema.CreateUserRequest) (*empty.Empty, error)
CreateUser Creates a new user
func (*ImmuServer) CurrentState ¶ added in v0.9.0
func (s *ImmuServer) CurrentState(ctx context.Context, e *empty.Empty) (*schema.ImmutableState, error)
CurrentState ...
func (*ImmuServer) DatabaseList ¶ added in v0.7.0
func (s *ImmuServer) DatabaseList(ctx context.Context, req *empty.Empty) (*schema.DatabaseListResponse, error)
DatabaseList returns a list of databases based on the requesting user permissins
func (*ImmuServer) DescribeTable ¶ added in v1.0.0
func (s *ImmuServer) DescribeTable(ctx context.Context, req *schema.Table) (*schema.SQLQueryResult, error)
func (*ImmuServer) ExecAll ¶ added in v0.9.0
func (s *ImmuServer) ExecAll(ctx context.Context, req *schema.ExecAllRequest) (*schema.TxMetadata, error)
func (*ImmuServer) Get ¶
func (s *ImmuServer) Get(ctx context.Context, req *schema.KeyRequest) (*schema.Entry, error)
Get ...
func (*ImmuServer) GetAll ¶ added in v0.9.0
func (s *ImmuServer) GetAll(ctx context.Context, req *schema.KeyListRequest) (*schema.Entries, error)
GetAll ...
func (*ImmuServer) Health ¶
func (s *ImmuServer) Health(ctx context.Context, e *empty.Empty) (*schema.HealthResponse, error)
Health ...
func (*ImmuServer) History ¶
func (s *ImmuServer) History(ctx context.Context, req *schema.HistoryRequest) (*schema.Entries, error)
History ...
func (*ImmuServer) Initialize ¶ added in v0.9.0
func (s *ImmuServer) Initialize() error
Initialize initializes dependencies, set up multi database capabilities and stats
func (*ImmuServer) ListTables ¶ added in v1.0.0
func (s *ImmuServer) ListTables(ctx context.Context, _ *empty.Empty) (*schema.SQLQueryResult, error)
func (*ImmuServer) ListUsers ¶
ListUsers returns a list of users based on the requesting user permissions
func (*ImmuServer) Login ¶
func (s *ImmuServer) Login(ctx context.Context, r *schema.LoginRequest) (*schema.LoginResponse, error)
Login ...
func (*ImmuServer) SQLExec ¶ added in v1.0.0
func (s *ImmuServer) SQLExec(ctx context.Context, req *schema.SQLExecRequest) (*schema.SQLExecResult, error)
func (*ImmuServer) SQLQuery ¶ added in v1.0.0
func (s *ImmuServer) SQLQuery(ctx context.Context, req *schema.SQLQueryRequest) (*schema.SQLQueryResult, error)
func (*ImmuServer) Scan ¶
func (s *ImmuServer) Scan(ctx context.Context, req *schema.ScanRequest) (*schema.Entries, error)
Scan ...
func (*ImmuServer) Set ¶
func (s *ImmuServer) Set(ctx context.Context, kv *schema.SetRequest) (*schema.TxMetadata, error)
Set ...
func (*ImmuServer) SetActiveUser ¶ added in v0.7.0
func (s *ImmuServer) SetActiveUser(ctx context.Context, r *schema.SetActiveUserRequest) (*empty.Empty, error)
SetActiveUser activate or deactivate a user
func (*ImmuServer) SetReference ¶ added in v0.9.0
func (s *ImmuServer) SetReference(ctx context.Context, req *schema.ReferenceRequest) (*schema.TxMetadata, error)
SetReference ...
func (*ImmuServer) Start ¶
func (s *ImmuServer) Start() (err error)
Start starts the immudb server Loads and starts the System DB, default db and user db
func (*ImmuServer) StreamExecAll ¶ added in v0.9.2
func (s *ImmuServer) StreamExecAll(str schema.ImmuService_StreamExecAllServer) error
func (*ImmuServer) StreamGet ¶ added in v0.9.2
func (s *ImmuServer) StreamGet(kr *schema.KeyRequest, str schema.ImmuService_StreamGetServer) error
StreamGet return a stream of key-values to the client
func (*ImmuServer) StreamHistory ¶ added in v0.9.2
func (s *ImmuServer) StreamHistory(request *schema.HistoryRequest, server schema.ImmuService_StreamHistoryServer) error
func (*ImmuServer) StreamScan ¶ added in v0.9.2
func (s *ImmuServer) StreamScan(req *schema.ScanRequest, str schema.ImmuService_StreamScanServer) error
func (*ImmuServer) StreamSet ¶ added in v0.9.2
func (s *ImmuServer) StreamSet(str schema.ImmuService_StreamSetServer) error
StreamSet set a stream of key-values in the internal store
func (*ImmuServer) StreamVerifiableGet ¶ added in v0.9.2
func (s *ImmuServer) StreamVerifiableGet(req *schema.VerifiableGetRequest, str schema.ImmuService_StreamVerifiableGetServer) error
StreamVerifiableGet ...
func (*ImmuServer) StreamVerifiableSet ¶ added in v0.9.2
func (s *ImmuServer) StreamVerifiableSet(str schema.ImmuService_StreamVerifiableSetServer) error
StreamVerifiableSet ...
func (*ImmuServer) StreamZScan ¶ added in v0.9.2
func (s *ImmuServer) StreamZScan(request *schema.ZScanRequest, server schema.ImmuService_StreamZScanServer) error
StreamZScan ...
func (*ImmuServer) TxScan ¶ added in v0.9.1
func (s *ImmuServer) TxScan(ctx context.Context, req *schema.TxScanRequest) (*schema.TxList, error)
TxScan ...
func (*ImmuServer) UpdateAuthConfig ¶
func (s *ImmuServer) UpdateAuthConfig(ctx context.Context, req *schema.AuthConfig) (*empty.Empty, error)
UpdateAuthConfig ...
func (*ImmuServer) UpdateMTLSConfig ¶
func (s *ImmuServer) UpdateMTLSConfig(ctx context.Context, req *schema.MTLSConfig) (*empty.Empty, error)
UpdateMTLSConfig ...
func (*ImmuServer) UseDatabase ¶ added in v0.7.0
func (s *ImmuServer) UseDatabase(ctx context.Context, db *schema.Database) (*schema.UseDatabaseReply, error)
UseDatabase ...
func (*ImmuServer) UseSnapshot ¶ added in v1.0.0
func (s *ImmuServer) UseSnapshot(ctx context.Context, req *schema.UseSnapshotRequest) (*empty.Empty, error)
func (*ImmuServer) VerifiableGet ¶ added in v0.9.0
func (s *ImmuServer) VerifiableGet(ctx context.Context, req *schema.VerifiableGetRequest) (*schema.VerifiableEntry, error)
VerifiableGet ...
func (*ImmuServer) VerifiableSQLGet ¶ added in v1.0.0
func (s *ImmuServer) VerifiableSQLGet(ctx context.Context, req *schema.VerifiableSQLGetRequest) (*schema.VerifiableSQLEntry, error)
func (*ImmuServer) VerifiableSet ¶ added in v0.9.0
func (s *ImmuServer) VerifiableSet(ctx context.Context, req *schema.VerifiableSetRequest) (*schema.VerifiableTx, error)
VerifiableSet ...
func (*ImmuServer) VerifiableSetReference ¶ added in v0.9.0
func (s *ImmuServer) VerifiableSetReference(ctx context.Context, req *schema.VerifiableReferenceRequest) (*schema.VerifiableTx, error)
VerifibleSetReference ...
func (*ImmuServer) VerifiableTxById ¶ added in v0.9.0
func (s *ImmuServer) VerifiableTxById(ctx context.Context, req *schema.VerifiableTxRequest) (*schema.VerifiableTx, error)
VerifiableTxByID ...
func (*ImmuServer) VerifiableZAdd ¶ added in v0.9.0
func (s *ImmuServer) VerifiableZAdd(ctx context.Context, req *schema.VerifiableZAddRequest) (*schema.VerifiableTx, error)
VerifiableZAdd ...
func (*ImmuServer) WithLogger ¶
func (s *ImmuServer) WithLogger(logger logger.Logger) ImmuServerIf
WithLogger ...
func (*ImmuServer) WithOptions ¶
func (s *ImmuServer) WithOptions(options *Options) ImmuServerIf
WithOptions ...
func (*ImmuServer) WithPgsqlServer ¶ added in v1.0.0
func (s *ImmuServer) WithPgsqlServer(psrv pgsqlsrv.Server) ImmuServerIf
WithPgsqlServer ...
func (*ImmuServer) WithStateSigner ¶ added in v0.9.0
func (s *ImmuServer) WithStateSigner(stateSigner StateSigner) ImmuServerIf
WithStateSigner ...
func (*ImmuServer) WithStreamServiceFactory ¶ added in v0.9.2
func (s *ImmuServer) WithStreamServiceFactory(ssf stream.ServiceFactory) ImmuServerIf
func (*ImmuServer) ZAdd ¶
func (s *ImmuServer) ZAdd(ctx context.Context, req *schema.ZAddRequest) (*schema.TxMetadata, error)
ZAdd ...
func (*ImmuServer) ZScan ¶
func (s *ImmuServer) ZScan(ctx context.Context, req *schema.ZScanRequest) (*schema.ZEntries, error)
ZScan ...
type ImmuServerIf ¶ added in v0.7.0
type ImmuServerIf interface { Initialize() error Start() error Stop() error WithOptions(options *Options) ImmuServerIf WithLogger(logger.Logger) ImmuServerIf WithStateSigner(stateSigner StateSigner) ImmuServerIf WithStreamServiceFactory(ssf stream.ServiceFactory) ImmuServerIf WithPgsqlServer(psrv pgsqlsrv.Server) ImmuServerIf }
type MetricsCollection ¶
type MetricsCollection struct { UptimeCounter prometheus.CounterFunc DBSizeGauges *prometheus.GaugeVec DBEntriesGauges *prometheus.GaugeVec RPCsPerClientCounters *prometheus.CounterVec LastMessageAtPerClientGauges *prometheus.GaugeVec // contains filtered or unexported fields }
MetricsCollection immudb Prometheus metrics collection
func (*MetricsCollection) UpdateClientMetrics ¶
func (mc *MetricsCollection) UpdateClientMetrics(ctx context.Context)
UpdateClientMetrics ...
func (*MetricsCollection) UpdateDBMetrics ¶ added in v1.0.0
func (mc *MetricsCollection) UpdateDBMetrics()
UpdateDBMetrics ...
func (*MetricsCollection) WithComputeDBEntries ¶ added in v1.0.0
func (mc *MetricsCollection) WithComputeDBEntries(f func() map[string]float64)
WithComputeDBEntries ...
func (*MetricsCollection) WithComputeDBSizes ¶ added in v1.0.0
func (mc *MetricsCollection) WithComputeDBSizes(f func() map[string]float64)
WithComputeDBSizes ...
func (*MetricsCollection) WithUptimeCounter ¶
func (mc *MetricsCollection) WithUptimeCounter(f func() float64)
WithUptimeCounter ...
type Options ¶
type Options struct { Dir string Network string Address string Port int MetricsPort int Config string Pidfile string Logfile string TLSConfig *tls.Config MaxRecvMsgSize int NoHistograms bool Detached bool MetricsServer bool WebServer bool WebServerPort int DevMode bool AdminPassword string `json:"-"` SigningKey string StoreOptions *store.Options StreamChunkSize int TokenExpiryTimeMin int PgsqlServer bool PgsqlServerPort int // contains filtered or unexported fields }
Options server options list
func (*Options) GetDefaultDbName ¶ added in v0.7.0
GetDefaultDbName returns the default database name
func (*Options) GetMaintenance ¶ added in v0.7.0
GetMaintenance gets maintenance mode
func (*Options) GetSystemAdminDbName ¶ added in v0.7.0
GetSystemAdminDbName returns the System database name
func (*Options) MetricsBind ¶
MetricsBind return metrics bind address
func (*Options) WithAddress ¶
WithAddress sets address
func (*Options) WithAdminPassword ¶ added in v0.6.2
WithAdminPassword ...
func (*Options) WithConfig ¶
WithConfig sets config file name
func (*Options) WithDetached ¶
WithDetached sets immudb to be run in background
func (*Options) WithDevMode ¶ added in v0.6.2
WithDevMode ...
func (*Options) WithListener ¶ added in v0.7.0
WithListener used usually to pass a bufered listener for testing purposes
func (*Options) WithLogfile ¶
WithLogfile sets logfile
func (*Options) WithMaintenance ¶ added in v0.7.0
WithMaintenance sets maintenance mode
func (*Options) WithMaxRecvMsgSize ¶ added in v0.8.1
func (*Options) WithMetricsServer ¶
WithMetricsServer ...
func (*Options) WithNetwork ¶
WithNetwork sets network
func (*Options) WithNoHistograms ¶
WithNoHistograms disables collection of histograms metrics (e.g. query durations)
func (*Options) WithPgsqlServer ¶ added in v1.0.0
PgsqlServerPort enable or disable pgsql server
func (*Options) WithPgsqlServerPort ¶ added in v1.0.0
PgsqlServerPort sets pgdsql server port
func (*Options) WithPidfile ¶
WithPidfile sets pid file
func (*Options) WithSigningKey ¶ added in v0.8.0
WithSigningKey sets signature private key
func (*Options) WithStoreOptions ¶ added in v0.9.1
func (*Options) WithStreamChunkSize ¶ added in v0.9.2
WithStreamChunkSize set the chunk size
func (*Options) WithTokenExpiryTime ¶ added in v1.0.0
WithTokenExpiryTime set authentication token expiration time in minutes
func (*Options) WithWebServer ¶ added in v1.0.0
WithWebServer ...
func (*Options) WithWebServerPort ¶ added in v1.0.0
WithWebServerPort ...
type PIDFile ¶
PIDFile contains path of pid file
type StateSigner ¶ added in v0.9.0
type StateSigner interface {
Sign(state *schema.ImmutableState) error
}
type UUIDContext ¶
type UUIDContext interface { UUIDStreamContextSetter(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error UUIDContextSetter(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) }
UUIDContext manage UUID context
type WrappedServerStream ¶
type WrappedServerStream struct {
grpc.ServerStream
}
WrappedServerStream ...
func (*WrappedServerStream) RecvMsg ¶
func (w *WrappedServerStream) RecvMsg(m interface{}) error
RecvMsg ...
func (*WrappedServerStream) SendMsg ¶
func (w *WrappedServerStream) SendMsg(m interface{}) error
SendMsg ...