Documentation ¶
Index ¶
- func Base64decode(body string) ([]byte, error)
- func Base64encode(body []byte) string
- func NewSQLGraphStore(rwdb, rodb *sqlx.DB, statements *Statements) (store.GraphStoreServer, error)
- func ResolveDriverName(dbmsName string) (string, error)
- func Retryable(delegate store.GraphStoreClient, maxAttempts int) store.GraphStoreClient
- type Statements
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64decode ¶
Base64decode convenience function
func NewSQLGraphStore ¶
func NewSQLGraphStore(rwdb, rodb *sqlx.DB, statements *Statements) (store.GraphStoreServer, error)
NewSQLGraphStore constructs a new GraphStore with a sql driven backend. Current queries support sqlite3 but should be able to work on mysql as well.
func ResolveDriverName ¶
ResolveDriverName resolves the sql driver to use for the given dbms system
func Retryable ¶
func Retryable(delegate store.GraphStoreClient, maxAttempts int) store.GraphStoreClient
Retryable wraps calls to the graphStore with an exponential backoff
Types ¶
type Statements ¶
type Statements struct { CreateGraphDataTable string `json:"createGraphDataTable"` InsertGraphData string `json:"insertGraphData"` DeleteGraphData string `json:"deleteGraphData"` ListGraphData string `json:"listGraphData"` SelectGraphDataUpstreamDependencies string `json:"selectGraphDataUpstreamDependencies"` SelectGraphDataDownstreamDependencies string `json:"selectGraphDataDownstreamDependencies"` }
Statements defines the SQL statements that are used by the GraphStore. Each statement should use named parameters.
func DefaultStatementsFor ¶
func DefaultStatementsFor(driver string) (*Statements, error)
DefaultStatementsFor the given database driver
func LoadStatements ¶
func LoadStatements(contents []byte) (*Statements, error)
LoadStatements parses contents into their corresponding statements
func LoadStatementsFile ¶
func LoadStatementsFile(yamlFile string) (*Statements, error)
LoadStatementsFile loads an external yaml file containing SQL statements
Click to show internal directories.
Click to hide internal directories.