Documentation ¶
Index ¶
- func FilterToExpression(f *filters.Filter, formatter func(string) string) string
- type ClassDefinition
- type Client
- func (c *Client) AlterProperty(className string, prop Property) error
- func (c *Client) Connect() error
- func (c *Client) CreateClass(class ClassDefinition) error
- func (c *Client) CreateDatabase() (Document, error)
- func (c *Client) CreateDocument(doc Document) (Document, error)
- func (c *Client) CreateDocumentClass(class ClassDefinition) error
- func (c *Client) CreateIndex(className string, index Index) error
- func (c *Client) CreateProperty(className string, prop Property) error
- func (c *Client) DeleteDocument(id string) error
- func (c *Client) DeleteDocumentClass(name string) error
- func (c *Client) GetDatabase() (Document, error)
- func (c *Client) GetDocument(id string) (Document, error)
- func (c *Client) GetDocumentClass(name string) (*DocumentClass, error)
- func (c *Client) Query(obj string, query *filters.SearchQuery, result interface{}) error
- func (c *Client) Request(method string, url string, body io.Reader) (*http.Response, error)
- func (c *Client) SQL(query string, result interface{}) error
- func (c *Client) Search(query string) ([]Document, error)
- func (c *Client) Upsert(doc Document, key string) (Document, error)
- type ClientInterface
- type Document
- type DocumentClass
- type Error
- type Errors
- type Index
- type Property
- type Result
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClassDefinition ¶
type ClassDefinition struct { Name string `json:"name"` SuperClass string `json:"superClass,omitempty"` SuperClasses []string `json:"superClasses,omitempty"` Abstract bool `json:"abstract"` StrictMode bool `json:"strictmode"` Alias string `json:"alias,omitempty"` Properties []Property `json:"properties,omitempty"` Indexes []Index `json:"indexes,omitempty"` }
ClassDefinition describes a OrientDB class definition
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client describes a OrientDB client database
func (*Client) AlterProperty ¶
AlterProperty modify a property
func (*Client) CreateClass ¶
func (c *Client) CreateClass(class ClassDefinition) error
CreateClass creates a new class
func (*Client) CreateDatabase ¶
CreateDatabase creates the root OrientDB Document
func (*Client) CreateDocument ¶
CreateDocument creates an OrientDB document
func (*Client) CreateDocumentClass ¶
func (c *Client) CreateDocumentClass(class ClassDefinition) error
CreateDocumentClass creates a new OrientDB document class
func (*Client) CreateIndex ¶
CreateIndex creates a new Index
func (*Client) CreateProperty ¶
CreateProperty creates a new class property
func (*Client) DeleteDocument ¶
DeleteDocument delete an OrientDB document
func (*Client) DeleteDocumentClass ¶
DeleteDocumentClass delete an OrientDB document class
func (*Client) GetDatabase ¶
GetDatabase returns the root OrientDB document
func (*Client) GetDocument ¶
GetDocument reterive a specific OrientDB document
func (*Client) GetDocumentClass ¶
func (c *Client) GetDocumentClass(name string) (*DocumentClass, error)
GetDocumentClass returns an OrientDB document class
func (*Client) Query ¶
func (c *Client) Query(obj string, query *filters.SearchQuery, result interface{}) error
Query the OrientDB based on filters
type ClientInterface ¶
type ClientInterface interface { Request(method string, url string, body io.Reader) (*http.Response, error) DeleteDocument(id string) error GetDocument(id string) (Document, error) CreateDocument(doc Document) (Document, error) Upsert(doc Document, key string) (Document, error) GetDocumentClass(name string) (*DocumentClass, error) AlterProperty(className string, prop Property) error CreateProperty(className string, prop Property) error CreateClass(class ClassDefinition) error CreateIndex(className string, index Index) error CreateDocumentClass(class ClassDefinition) error DeleteDocumentClass(name string) error GetDatabase() (Document, error) CreateDatabase() (Document, error) SQL(query string, result interface{}) error Search(query string) ([]Document, error) Query(obj string, query *filters.SearchQuery, result interface{}) error Connect() error }
ClientInterface describes the mechanism API of OrientDB database client
type Document ¶
type Document map[string]interface{}
Document describes an orientdb docmuent interface
type DocumentClass ¶
type DocumentClass struct {
Class ClassDefinition `json:"class"`
}
DocumentClass describes OrientDB document
type Error ¶
type Error struct { Code int `json:"code"` Reason int `json:"reason"` Content string `json:"content"` }
Error describes a OrientDB error
type Errors ¶
type Errors struct {
Errors []Error `json:"errors"`
}
Errors describes a list of OrientDB errors
type Index ¶
type Index struct { Name string `json:"name"` Type string `json:"type"` Fields []string `json:"fields"` }
Index describes a OrientDB index
type Property ¶
type Property struct { Name string `json:"name,omitempty"` Type string `json:"type,omitempty"` LinkedType string `json:"linkedType,omitempty"` LinkedClass string `json:"linkedClass,omitempty"` Mandatory bool `json:"mandatory"` NotNull bool `json:"notNull"` ReadOnly bool `json:"readonly"` Collate string `json:"collate,omitempty"` Regexp string `json:"regexp,omitempty"` }
Property describes a OrientDB property