database

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2022 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DONE = errors.New("DONE")

	// An error indicating a given key does not exist
	ErrNotFound             = errors.New("not found")
	ErrAlreadyExists        = errors.New("already exists")
	ErrUnsupportedAlgorithm = errors.New("unsupported algorithm")
	ErrFailedToGetUser      = errors.New("failed to get user")
)

Functions

This section is empty.

Types

type Graph

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

func NewGraph

func NewGraph(openID string, opts ...Opt) (*Graph, error)

NewGraph takes a file path and returns a connected Raft backend.

func (*Graph) AggregateConnections

func (n *Graph) AggregateConnections(ctx context.Context, filter *apipb.AggFilter) (*apipb.Number, error)

func (*Graph) AggregateDocs

func (n *Graph) AggregateDocs(ctx context.Context, filter *apipb.AggFilter) (*apipb.Number, error)

func (*Graph) AllConnections

func (n *Graph) AllConnections(ctx context.Context) (*apipb.Connections, error)

func (*Graph) AllDocs

func (n *Graph) AllDocs(ctx context.Context) (*apipb.Docs, error)

func (*Graph) Broadcast

func (g *Graph) Broadcast(ctx context.Context, message *apipb.OutboundMessage) (*empty.Empty, error)

func (*Graph) Close

func (b *Graph) Close()

Close is used to gracefully close the Database.

func (*Graph) ClusterState

func (g *Graph) ClusterState(ctx context.Context, _ *empty.Empty) (*apipb.RaftState, error)

func (*Graph) ConnectionTypes

func (g *Graph) ConnectionTypes(ctx context.Context) ([]string, error)

func (*Graph) ConnectionsFrom

func (g *Graph) ConnectionsFrom(ctx context.Context, filter *apipb.ConnectFilter) (*apipb.Connections, error)

func (*Graph) ConnectionsTo

func (g *Graph) ConnectionsTo(ctx context.Context, filter *apipb.ConnectFilter) (*apipb.Connections, error)

func (*Graph) CreateConnection

func (g *Graph) CreateConnection(ctx context.Context, constructor *apipb.ConnectionConstructor) (*apipb.Connection, error)

func (*Graph) CreateConnections

func (g *Graph) CreateConnections(ctx context.Context, constructors *apipb.ConnectionConstructors) (*apipb.Connections, error)

func (*Graph) CreateDoc

func (g *Graph) CreateDoc(ctx context.Context, constructor *apipb.DocConstructor) (*apipb.Doc, error)

func (*Graph) CreateDocs

func (g *Graph) CreateDocs(ctx context.Context, constructors *apipb.DocConstructors) (*apipb.Docs, error)

func (*Graph) DelConnection

func (g *Graph) DelConnection(ctx context.Context, path *apipb.Ref) (*empty.Empty, error)

func (*Graph) DelConnections

func (g *Graph) DelConnections(ctx context.Context, filter *apipb.Filter) (*empty.Empty, error)

func (*Graph) DelDoc

func (g *Graph) DelDoc(ctx context.Context, path *apipb.Ref) (*empty.Empty, error)

func (*Graph) DelDocs

func (g *Graph) DelDocs(ctx context.Context, filter *apipb.Filter) (*empty.Empty, error)

func (*Graph) DocTypes

func (g *Graph) DocTypes(ctx context.Context) ([]string, error)

func (*Graph) EditConnection

func (n *Graph) EditConnection(ctx context.Context, value *apipb.Edit) (*apipb.Connection, error)

func (*Graph) EditConnections

func (n *Graph) EditConnections(ctx context.Context, patch *apipb.EditFilter) (*apipb.Connections, error)

func (*Graph) EditDoc

func (n *Graph) EditDoc(ctx context.Context, value *apipb.Edit) (*apipb.Doc, error)

func (*Graph) EditDocs

func (n *Graph) EditDocs(ctx context.Context, patch *apipb.EditFilter) (*apipb.Docs, error)

func (*Graph) ExistsConnection

func (g *Graph) ExistsConnection(ctx context.Context, has *apipb.ExistsFilter) (*apipb.Boolean, error)

func (*Graph) ExistsDoc

func (g *Graph) ExistsDoc(ctx context.Context, has *apipb.ExistsFilter) (*apipb.Boolean, error)

func (*Graph) GetConnection

func (g *Graph) GetConnection(ctx context.Context, path *apipb.Ref) (*apipb.Connection, error)

func (*Graph) GetDoc

func (g *Graph) GetDoc(ctx context.Context, path *apipb.Ref) (*apipb.Doc, error)

func (*Graph) GetSchema

func (g *Graph) GetSchema(ctx context.Context, _ *empty.Empty) (*apipb.Schema, error)

func (*Graph) HasConnection

func (g *Graph) HasConnection(ctx context.Context, ref *apipb.Ref) (*apipb.Boolean, error)

func (*Graph) HasDoc

func (g *Graph) HasDoc(ctx context.Context, ref *apipb.Ref) (*apipb.Boolean, error)

func (*Graph) JoinCluster

func (g *Graph) JoinCluster(ctx context.Context, peer *apipb.Peer) (*empty.Empty, error)

func (*Graph) Me

func (g *Graph) Me(ctx context.Context, _ *empty.Empty) (*apipb.Doc, error)

func (*Graph) Ping

func (g *Graph) Ping(ctx context.Context, e *empty.Empty) (*apipb.Pong, error)

func (*Graph) PushConnectionConstructors

func (g *Graph) PushConnectionConstructors(server apipb.DatabaseService_PushConnectionConstructorsServer) error

func (*Graph) PushDocConstructors

func (g *Graph) PushDocConstructors(server apipb.DatabaseService_PushDocConstructorsServer) error

func (*Graph) PutConnection

func (g *Graph) PutConnection(ctx context.Context, connection *apipb.Connection) (*apipb.Connection, error)

func (*Graph) PutConnections

func (g *Graph) PutConnections(ctx context.Context, connections *apipb.Connections) (*apipb.Connections, error)

func (*Graph) PutDoc

func (g *Graph) PutDoc(ctx context.Context, doc *apipb.Doc) (*apipb.Doc, error)

func (*Graph) PutDocs

func (g *Graph) PutDocs(ctx context.Context, docs *apipb.Docs) (*apipb.Docs, error)

func (*Graph) Raft

func (g *Graph) Raft() *raft.Raft

func (*Graph) RaftFSM

func (g *Graph) RaftFSM() *fsm.FSM

func (*Graph) RaftSecret

func (g *Graph) RaftSecret() string

func (*Graph) SearchAndConnect

func (g *Graph) SearchAndConnect(ctx context.Context, filter *apipb.SearchConnectFilter) (*apipb.Connections, error)

func (*Graph) SearchAndConnectMe

func (g *Graph) SearchAndConnectMe(ctx context.Context, filter *apipb.SearchConnectMeFilter) (*apipb.Connections, error)

func (*Graph) SearchConnections

func (e *Graph) SearchConnections(ctx context.Context, filter *apipb.Filter) (*apipb.Connections, error)

func (*Graph) SearchDocs

func (n *Graph) SearchDocs(ctx context.Context, filter *apipb.Filter) (*apipb.Docs, error)

func (*Graph) SeedConnections

func (g *Graph) SeedConnections(server apipb.DatabaseService_SeedConnectionsServer) error

func (*Graph) SeedDocs

func (g *Graph) SeedDocs(server apipb.DatabaseService_SeedDocsServer) error

func (*Graph) SetAuthorizers

func (g *Graph) SetAuthorizers(ctx context.Context, as *apipb.Authorizers) (*empty.Empty, error)

func (*Graph) SetConstraints

func (g *Graph) SetConstraints(ctx context.Context, as *apipb.Constraints) (*empty.Empty, error)

func (*Graph) SetIndexes

func (g *Graph) SetIndexes(ctx context.Context, index2 *apipb.Indexes) (*empty.Empty, error)

func (*Graph) SetRaft

func (g *Graph) SetRaft(raft *raft.Raft)

func (*Graph) SetTriggers

func (g *Graph) SetTriggers(ctx context.Context, triggers *apipb.Triggers) (*empty.Empty, error)

func (*Graph) Stream

func (g *Graph) Stream(filter *apipb.StreamFilter, server apipb.DatabaseService_StreamServer) error

func (*Graph) StreamInterceptor

func (g *Graph) StreamInterceptor() grpc.StreamServerInterceptor

func (*Graph) Traverse

func (n *Graph) Traverse(ctx context.Context, filter *apipb.TraverseFilter) (*apipb.Traversals, error)

func (*Graph) TraverseMe

func (n *Graph) TraverseMe(ctx context.Context, filter *apipb.TraverseMeFilter) (*apipb.Traversals, error)

func (*Graph) UnaryInterceptor

func (g *Graph) UnaryInterceptor() grpc.UnaryServerInterceptor

type Opt

type Opt func(o *Options)

func WithLogger

func WithLogger(lgger *logger.Logger) Opt

func WithMachine

func WithMachine(mach *machine.Machine) Opt

func WithRaftSecret

func WithRaftSecret(raftSecret string) Opt

func WithRequireRequestAuthorizers

func WithRequireRequestAuthorizers(require bool) Opt

func WithRequireResponseAuthorizers

func WithRequireResponseAuthorizers(require bool) Opt

func WithRootUsers

func WithRootUsers(rootUsers []string) Opt

func WithStoragePath

func WithStoragePath(storagePath string) Opt

type Options

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

func (*Options) SetDefaults

func (o *Options) SetDefaults() error

Jump to

Keyboard shortcuts

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