Categorygithub.com/mutablelogic/go-accessory
modulepackage
0.0.3
Repository: https://github.com/mutablelogic/go-accessory.git
Documentation: pkg.go.dev

# README

go-accessory

accessory is a database client for communication with supported database servers, and some patterns for using databases in a multi-threaded and multi-host environment.

It provides a simple binding with go structures.

Database Connections

There are currently two implementations of a database connection. They are:

  • MongoDB
  • sqlite

Both are "in development" and require testing. In order to create a direct database connection, use one of these:

ImportConstructorDescription
github.com/mutablelogic/go-accessory/pkg/mongodbmongodb.New(ctx, url, opts...)Create a MongoDB connection to a remote server
github.com/mutablelogic/go-accessory/pkg/sqlitesqlite.New(ctx, url, opts...)Open a sqlite connection to file or in-memory database

In either case, the url is a string that is parsed by the database driver, which should be of scheme mongodb://, mongodb+srv://, file:// or sqlite://. The opts are a list of options that are passed to the database driver (see the documentation for the driver for details).

Mapping Collections to Structures

TODO

Database Operations

TODO

Connection Pools

TODO

Task Queues

TODO

# Packages

No description provided by the author
No description provided by the author

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
time.Duration: The maximum age of the task (how long it has been in the queue).
time.Time: The time the task was created.
time.Time: When the task expires (if not executed before this time).
string: The last task error.
int: The priority of the task (higher is more important).
int: The number of times the task has been retried.
time.Time: The time the task is scheduled to be executed.
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

Tag represents some task metadata, including Priority and ScheduledAt.

# Interfaces

Auth represents authorzation storage.
AuthToken represents an authorization token.
No description provided by the author
Conn represents a connection to a database server.
No description provided by the author
Cursor represents an iterable cursor to a result set.
Database represents a specific database on the server on which operations can be performed.
No description provided by the author
Name represents an SQL name (table name, column name).
Pool represents a connection pool.
Query represents any kind of SQL Query.
Sort represents a sort specification for a query.
Task represents a task.
TaskQueue represents a set of tasks to be executed in order.

# Type aliases

No description provided by the author
No description provided by the author
WorkerFunc is used for executing tasks.