component

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrDuplicate                    = 1207
	ErrGraphDuplicate               = 1925
	ErrCollectionAlreadyInGraph     = 1938
	ErrCollectionAlreadyInEdgeGraph = 1929
	ErrEdgeAlreadyInGraph           = 1920
)

For more info in regard of this error codes go to https://www.arangodb.com/docs/stable/appendix-error-codes.html

Variables

This section is empty.

Functions

func NewClientRedis added in v0.4.0

func NewClientRedis(db int) *redis.Client

func NewLogger

func NewLogger() *log.Entry

func NewMYSQL

func NewMYSQL(host string) (*sql.DB, error)

func NewPSQL

func NewPSQL(host string) (*sql.DB, error)

Types

type Arango added in v0.8.0

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

func NewArango added in v0.8.0

func NewArango(db string, endpoints []string, user, password string, options ...OptionArango) *Arango

func (*Arango) CreateCollections added in v0.8.1

func (a *Arango) CreateCollections(ctx context.Context, collections []Collection) error

func (*Arango) CreateCursorWithIdAndTime added in v0.10.0

func (a *Arango) CreateCursorWithIdAndTime(id string, createdAt time.Time) string

CreateCursorWithIdAndTime gets a cursor using the Id and createdAt

func (*Arango) CreateGraph added in v0.8.1

func (a *Arango) CreateGraph(ctx context.Context, graph *Graph) error

func (*Arango) DB added in v0.8.1

func (a *Arango) DB() driver.Database

func (*Arango) EnhanceBindVarsWithIdTimeCursor added in v0.10.0

func (a *Arango) EnhanceBindVarsWithIdTimeCursor(bindVars map[string]interface{}, pagination Pagination) (map[string]interface{}, error)

EnhanceBinVarsWithIdTimeCursor adds an extra set of bindVars used for pagination and adds a limit to the pagination

func (*Arango) GetIDTimeCursor added in v0.10.0

func (a *Arango) GetIDTimeCursor(cursor string) (string, time.Time, error)

func (*Arango) InitDB added in v0.8.2

func (a *Arango) InitDB(ctx context.Context) error

type Collection added in v0.8.0

type Collection struct {
	Name    string
	Indexes []Index
}

type DriverName

type DriverName string
const (
	Postgres DriverName = "postgres"
	Mysql    DriverName = "mysql"
)

type Edge added in v0.8.0

type Edge struct {
	Name    string
	Indexes []Index
	// From: contains the names of one or more vertex collections that can contain source vertices.
	// To: contains the names of one or more edge collections that can contain target vertices
	From []string
	To   []string
}

type FullTextIndex added in v0.9.1

type FullTextIndex struct {
	MinLength int
	IxName    string
	IxFields  []string
}

func (FullTextIndex) Fields added in v0.9.1

func (g FullTextIndex) Fields() []string

func (FullTextIndex) Name added in v0.9.1

func (g FullTextIndex) Name() string

type GRPCServer added in v0.5.0

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

func NewGRPCServer added in v0.5.0

func NewGRPCServer() *GRPCServer

func (*GRPCServer) ListenAddress added in v0.5.0

func (s *GRPCServer) ListenAddress() string

func (*GRPCServer) Server added in v0.5.0

func (s *GRPCServer) Server() *grpc.Server

type GeoIndex added in v0.8.0

type GeoIndex struct {
	IxName   string
	IxFields []string
	GeoJson  bool
}

func (GeoIndex) Fields added in v0.8.0

func (g GeoIndex) Fields() []string

func (GeoIndex) Name added in v0.8.0

func (g GeoIndex) Name() string

type Graph added in v0.8.0

type Graph struct {
	Name     string
	Edges    []Edge
	Vertexes []Collection
}

type HashIndex added in v0.8.0

type HashIndex struct {
	IxName   string
	IxFields []string
	Unique   bool
	Sparse   bool
}

func (HashIndex) Fields added in v0.8.0

func (g HashIndex) Fields() []string

func (HashIndex) Name added in v0.8.0

func (g HashIndex) Name() string

type Index added in v0.8.0

type Index interface {
	Name() string
	Fields() []string
}

type IndexType added in v0.8.0

type IndexType int

type OptionArango added in v0.8.0

type OptionArango func(*Arango)

type OptionServer

type OptionServer func(*Server)

func OptionErrorLogWriter

func OptionErrorLogWriter(log io.Writer) OptionServer

type Pagination added in v0.10.0

type Pagination struct {
	Limit int
	After string
}

type Server

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

func NewServer

func NewServer(handler http.Handler, options ...OptionServer) *Server

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

type TTLIndex added in v0.8.4

type TTLIndex struct {
	IxName      string
	IxField     string
	ExpireAfter int
}

func (TTLIndex) Fields added in v0.8.4

func (g TTLIndex) Fields() []string

func (TTLIndex) Name added in v0.8.4

func (g TTLIndex) Name() string

Jump to

Keyboard shortcuts

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