data

package module
Version: v0.0.0-...-8b9244f Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2018 License: Apache-2.0 Imports: 1 Imported by: 0

README

Go Data

Go Data is a pluggable framework for data access

Overview

Data access is at the core of most applications. In many instances we want a simplified CRUD experience. In a lot of those cases we don't even want to have to write the CRUD aspect. At times we may have a more low level requirement for graph, doocument or other types of data model. Go Data looks to solve these problems in a single place with a pluggable architecture.

Go Data takes on the Go Micro approach and will include code generation for CRUD in future.

Note: WIP. Much of this will break and change.

TODO

  • explore the concept of a Model interface
  • individual packages for data models {kv, sql, graph, document}
  • top level interfaces like CRUD and Stream
  • implementations of each package
  • realtime data interface?
  • timeseries interface?
  • search interface? e.g elasticsearch, lucene

Documentation

Overview

Package data provides a framework for data access

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CRUD

type CRUD interface {
	Read(string) (Record, error)
	Create(Record) error
	Update(Record) error
	Delete(string) error
	Search(...SearchOption) ([]Record, error)
}

crud represents a top-level data model

type DB

type DB interface {
	CRUD
	Close() error
	Init(...Option) error
	Options() Options
	String() string
}

DB represents a crud interface

type Metadata

type Metadata map[string]interface{}

type Option

type Option func(*Options)

type Options

type Options struct {
	Database string
	Table    string

	// For alternative options
	Context context.Context
}

type Record

type Record interface {
	Id() string
	Created() int64
	Updated() int64
	Metadata() Metadata
	Bytes() []byte
	Scan(v interface{}) error
}

type SearchOption

type SearchOption func(*SearchOptions)

type SearchOptions

type SearchOptions struct {
	Metadata Metadata
	Limit    int64
	Offset   int64
}

Source Files

Directories

Path Synopsis
Package blob represents blob storage
Package blob represents blob storage
db
mock
Package mock mocks the DB
Package mock mocks the DB
type File represents file access to a resource
type File represents file access to a resource
Package kv provides a keyvalue interface
Package kv provides a keyvalue interface
Package sql provides a SQL interface
Package sql provides a SQL interface

Jump to

Keyboard shortcuts

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