Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadTransportCredentials

func LoadTransportCredentials(caCertificateFile string) (credentials.TransportCredentials, error)

    LoadTransportCredentials loads the transport credentials from the given CA certificate

    Types

    type Client

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

    func NewClient

    func NewClient(ctx context.Context, target string, opts ...Opt) (*Client, error)
    Example
    Output:
    
    PONG
    

    func (*Client) AggregateConnections

    func (c *Client) AggregateConnections(ctx context.Context, in *apipb.AggFilter, opts ...grpc.CallOption) (*apipb.Number, error)

      AggregateConnections executes an aggregation function against a set of connections

      func (*Client) AggregateDocs

      func (c *Client) AggregateDocs(ctx context.Context, in *apipb.AggFilter, opts ...grpc.CallOption) (*apipb.Number, error)

        AggregateDocs executes an aggregation function against a set of documents

        func (*Client) Broadcast

        func (c *Client) Broadcast(ctx context.Context, in *apipb.OutboundMessage, opts ...grpc.CallOption) error

          Broadcast broadcasts a message to a pubsub channel

          Example
          Output:
          
          success!
          

          func (*Client) ClusterState

          func (c *Client) ClusterState(ctx context.Context, _ *empty.Empty, opts ...grpc.CallOption) error

            ClusterState returns information about the raft cluster

            func (*Client) ConnectionsFrom

            func (c *Client) ConnectionsFrom(ctx context.Context, in *apipb.ConnectFilter, opts ...grpc.CallOption) (*apipb.Connections, error)

              ConnectionsFrom returns connections from the given doc that pass the filter

              func (*Client) ConnectionsTo

              func (c *Client) ConnectionsTo(ctx context.Context, in *apipb.ConnectFilter, opts ...grpc.CallOption) (*apipb.Connections, error)

                ConnectionsTo returns connections to the given doc that pass the filter

                func (*Client) CreateConnection

                func (c *Client) CreateConnection(ctx context.Context, in *apipb.ConnectionConstructor, opts ...grpc.CallOption) (*apipb.Connection, error)

                  CreateConnection creates a single connection in the graph

                  Example
                  Output:
                  
                  true
                  

                  func (*Client) CreateConnections

                  func (c *Client) CreateConnections(ctx context.Context, in *apipb.ConnectionConstructors, opts ...grpc.CallOption) (*apipb.Connections, error)

                    CreateConnections creates 1-many connections in the graph

                    func (*Client) CreateDoc

                    func (c *Client) CreateDoc(ctx context.Context, in *apipb.DocConstructor, opts ...grpc.CallOption) (*apipb.Doc, error)

                      CreateDoc creates a single doc in the graph

                      Example
                      Output:
                      
                      Charlie
                      

                      func (*Client) CreateDocs

                      func (c *Client) CreateDocs(ctx context.Context, in *apipb.DocConstructors, opts ...grpc.CallOption) (*apipb.Docs, error)

                        CreateDocs creates 1-many documents in the graph

                        func (*Client) DelConnection

                        func (c *Client) DelConnection(ctx context.Context, in *apipb.Ref, opts ...grpc.CallOption) error

                          DelConnection deletes a single connection that pass a Filter

                          func (*Client) DelConnections

                          func (c *Client) DelConnections(ctx context.Context, in *apipb.Filter, opts ...grpc.CallOption) error

                            DelConnections deletes 0-many connections that pass a Filter

                            Example
                            Output:
                            
                            Success!
                            

                            func (*Client) DelDoc

                            func (c *Client) DelDoc(ctx context.Context, in *apipb.Ref, opts ...grpc.CallOption) error

                              DelDoc deletes a doc by reference

                              func (*Client) DelDocs

                              func (c *Client) DelDocs(ctx context.Context, in *apipb.Filter, opts ...grpc.CallOption) error

                                DelDocs deletes 0-many docs that pass a Filter

                                Example
                                Output:
                                
                                Success!
                                

                                func (*Client) EditConnection

                                func (c *Client) EditConnection(ctx context.Context, in *apipb.Edit, opts ...grpc.CallOption) (*apipb.Connection, error)

                                  EditConnection edites a single connection in the graph

                                  func (*Client) EditConnections

                                  func (c *Client) EditConnections(ctx context.Context, in *apipb.EditFilter, opts ...grpc.CallOption) (*apipb.Connections, error)

                                    EditConnections edites 0-many connections in the graph

                                    func (*Client) EditDoc

                                    func (c *Client) EditDoc(ctx context.Context, in *apipb.Edit, opts ...grpc.CallOption) (*apipb.Doc, error)

                                      EditDoc edites a single doc in the graph

                                      Example
                                      Output:
                                      
                                      25
                                      

                                      func (*Client) EditDocs

                                      func (c *Client) EditDocs(ctx context.Context, in *apipb.EditFilter, opts ...grpc.CallOption) (*apipb.Docs, error)

                                        EditDocs edites 0-many docs in the graph

                                        func (*Client) ExistsConnection

                                        func (c *Client) ExistsConnection(ctx context.Context, in *apipb.ExistsFilter, opts ...grpc.CallOption) (*apipb.Boolean, error)

                                          ExistsConnection checks if a connection exists in the graph

                                          func (*Client) ExistsDoc

                                          func (c *Client) ExistsDoc(ctx context.Context, in *apipb.ExistsFilter, opts ...grpc.CallOption) (*apipb.Boolean, error)

                                            ExistsDoc checks if a doc exists in the graph

                                            func (*Client) GetConnection

                                            func (c *Client) GetConnection(ctx context.Context, in *apipb.Ref, opts ...grpc.CallOption) (*apipb.Connection, error)

                                              GetConnection gets a connection at the given ref

                                              func (*Client) GetDoc

                                              func (c *Client) GetDoc(ctx context.Context, in *apipb.Ref, opts ...grpc.CallOption) (*apipb.Doc, error)

                                                GetDoc gets a doc at the given ref

                                                func (*Client) GetSchema

                                                func (c *Client) GetSchema(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*apipb.Schema, error)

                                                  GetSchema gets information about node/connection types, type-validators, indexes, and authorizers

                                                  Example
                                                  Output:
                                                  
                                                  doc types: dog,human,note,user
                                                  connection types: created,created_by,edited,edited_by,owner
                                                  authorizers: testing-request
                                                  

                                                  func (*Client) HasConnection

                                                  func (c *Client) HasConnection(ctx context.Context, in *apipb.Ref, opts ...grpc.CallOption) (*apipb.Boolean, error)

                                                    HasConnection checks if a connection exists in the graph by reference

                                                    func (*Client) HasDoc

                                                    func (c *Client) HasDoc(ctx context.Context, in *apipb.Ref, opts ...grpc.CallOption) (*apipb.Boolean, error)

                                                      HasDoc checks if a doc exists in the graph by reference

                                                      Example
                                                      Output:
                                                      
                                                      true
                                                      

                                                      func (*Client) JoinCluster

                                                      func (c *Client) JoinCluster(ctx context.Context, peer *apipb.Peer, opts ...grpc.CallOption) error

                                                        AddPeer adds a peer node to the raft cluster.

                                                        func (*Client) Me

                                                        func (c *Client) Me(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*apipb.Doc, error)

                                                          Me returns a Doc of the currently logged in user

                                                          Example
                                                          Output:
                                                          
                                                          107146673535247272789
                                                          

                                                          func (*Client) Ping

                                                          func (c *Client) Ping(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*apipb.Pong, error)

                                                            Ping checks if the server is healthy.

                                                            Example
                                                            Output:
                                                            
                                                            PONG
                                                            

                                                            func (*Client) PushConnectionConstructors

                                                            func (c *Client) PushConnectionConstructors(ctx context.Context, ch <-chan *apipb.ConnectionConstructor, opts ...grpc.CallOption) error

                                                              PushConnectionConstructors streams connection constructors to & from the graph as they are created

                                                              func (*Client) PushDocConstructors

                                                              func (c *Client) PushDocConstructors(ctx context.Context, ch <-chan *apipb.DocConstructor, opts ...grpc.CallOption) error

                                                                PushDocConstructors streams doc constructors to & from the graph as they are created

                                                                func (*Client) PutConnection

                                                                func (c *Client) PutConnection(ctx context.Context, in *apipb.Connection, opts ...grpc.CallOption) (*apipb.Connection, error)

                                                                  PutConnection create-or-replaces a Connection in the graph

                                                                  func (*Client) PutConnections

                                                                  func (c *Client) PutConnections(ctx context.Context, in *apipb.Connections, opts ...grpc.CallOption) (*apipb.Connections, error)

                                                                    PutConnections puts a batch of connections in the graph

                                                                    func (*Client) PutDoc

                                                                    func (c *Client) PutDoc(ctx context.Context, in *apipb.Doc, opts ...grpc.CallOption) (*apipb.Doc, error)

                                                                      PutDocs puts a batch of docs in the graph

                                                                      Example
                                                                      Output:
                                                                      
                                                                      true
                                                                      

                                                                      func (*Client) PutDocs

                                                                      func (c *Client) PutDocs(ctx context.Context, in *apipb.Docs, opts ...grpc.CallOption) (*apipb.Docs, error)

                                                                        PutDoc creates a Doc if it doesnt exist already, otherwise it replaces it

                                                                        func (*Client) SearchAndConnect

                                                                        func (c *Client) SearchAndConnect(ctx context.Context, in *apipb.SearchConnectFilter, opts ...grpc.CallOption) (*apipb.Connections, error)

                                                                          SearchAndConnect searches for documents and forms connections based on whether they pass a filter

                                                                          func (*Client) SearchAndConnectMe

                                                                          func (c *Client) SearchAndConnectMe(ctx context.Context, in *apipb.SearchConnectMeFilter, opts ...grpc.CallOption) (*apipb.Connections, error)

                                                                            SearchAndConnectMe searches for documents and forms connections between the origin user & the document based on whether they pass a filter

                                                                            func (*Client) SearchConnections

                                                                            func (c *Client) SearchConnections(ctx context.Context, in *apipb.Filter, opts ...grpc.CallOption) (*apipb.Connections, error)

                                                                              SearchConnections searches for 0-many connections

                                                                              Example
                                                                              Output:
                                                                              
                                                                              true
                                                                              

                                                                              func (*Client) SearchDocs

                                                                              func (c *Client) SearchDocs(ctx context.Context, in *apipb.Filter, opts ...grpc.CallOption) (*apipb.Docs, error)

                                                                                SearchDocs searches for 0-many docs

                                                                                Example
                                                                                Output:
                                                                                
                                                                                Charlie
                                                                                

                                                                                func (*Client) SeedConnections

                                                                                func (c *Client) SeedConnections(ctx context.Context, connectionChan <-chan *apipb.Connection, opts ...grpc.CallOption) error

                                                                                  SeedConnections

                                                                                  func (*Client) SeedDocs

                                                                                  func (c *Client) SeedDocs(ctx context.Context, docChan <-chan *apipb.Doc, opts ...grpc.CallOption) error

                                                                                    SeedDocs

                                                                                    func (*Client) SetAuthorizers

                                                                                    func (c *Client) SetAuthorizers(ctx context.Context, in *apipb.Authorizers, opts ...grpc.CallOption) error

                                                                                      SetAuthorizers sets all of the authorizers in the graph

                                                                                      Example
                                                                                      Output:
                                                                                      
                                                                                      testing-request
                                                                                      

                                                                                      func (*Client) SetConstraints

                                                                                      func (c *Client) SetConstraints(ctx context.Context, in *apipb.Constraints, opts ...grpc.CallOption) error

                                                                                        SetConstraints sets all of the type validators in the graph

                                                                                        Example
                                                                                        Output:
                                                                                        
                                                                                        testing
                                                                                        

                                                                                        func (*Client) SetIndexes

                                                                                        func (c *Client) SetIndexes(ctx context.Context, in *apipb.Indexes, opts ...grpc.CallOption) error

                                                                                          SetIndexes sets all of the indexes in the graph

                                                                                          Example
                                                                                          Output:
                                                                                          
                                                                                          testing
                                                                                          

                                                                                          func (*Client) SetTriggers

                                                                                          func (c *Client) SetTriggers(ctx context.Context, in *apipb.Triggers, opts ...grpc.CallOption) error

                                                                                            SetTriggers sets all of the triggers in the graph

                                                                                            func (*Client) Stream

                                                                                            func (c *Client) Stream(ctx context.Context, in *apipb.StreamFilter, handler func(msg *apipb.Message) bool, opts ...grpc.CallOption) error

                                                                                              Stream opens a stream of messages that pass a filter on a pubsub channel

                                                                                              Example
                                                                                              Output:
                                                                                              
                                                                                              hello world
                                                                                              

                                                                                              func (*Client) Traverse

                                                                                              func (c *Client) Traverse(ctx context.Context, in *apipb.TraverseFilter, opts ...grpc.CallOption) (*apipb.Traversals, error)

                                                                                                Traverse searches for 0-many docs using a graph traversal algorithm

                                                                                                Example
                                                                                                Output:
                                                                                                
                                                                                                1
                                                                                                3
                                                                                                

                                                                                                func (*Client) TraverseMe

                                                                                                func (c *Client) TraverseMe(ctx context.Context, in *apipb.TraverseMeFilter, opts ...grpc.CallOption) (*apipb.Traversals, error)

                                                                                                  TraverseMe executes a graph traversal searching for docs related to the currently logged in user

                                                                                                  type Opt

                                                                                                  type Opt func(o *Options)

                                                                                                  func WithLogging

                                                                                                  func WithLogging(logging, logPayload bool) Opt

                                                                                                  func WithMetrics

                                                                                                  func WithMetrics(metrics bool) Opt

                                                                                                  func WithRaftSecret

                                                                                                  func WithRaftSecret(raftSecret string) Opt

                                                                                                  func WithRetry

                                                                                                  func WithRetry(retry uint) Opt

                                                                                                  func WithTokenSource

                                                                                                  func WithTokenSource(tokenSource oauth2.TokenSource) Opt

                                                                                                  func WithTransportCreds

                                                                                                  func WithTransportCreds(creds credentials.TransportCredentials) Opt

                                                                                                  type Options

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

                                                                                                  Source Files