dataservice

package
v0.0.0-...-ebc0203 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package dataservice and it's sub-package represents data persistence service, mainly access database, but also including data persisted by other Micro-service. For Micro-server, only the interface is defined in this package, the data transformation code is in adapter package This is the top level package and it only defines interface, and all implementations are defined in sub-package Use case package depends on it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheDataInterface

type CacheDataInterface interface {
	// Get handles call to Get function on Cache service
	Get(key string) ([]byte, error)
	// Store handles call to Store function on Cache service
	Store(key string, value []byte) error
}

CacheDataInterface represents interface for cache service, which is a micro-service

type UserDataInterface

type UserDataInterface interface {
	// Remove deletes a user by user name from database.
	Remove(username string) (rowsAffected int64, err error)
	// Find retrieves a user from database based on a user's id
	Find(id int) (*model.User, error)
	// FindByName retrieves a user from database by User.Name
	FindByName(name string) (user *model.User, err error)
	// FindAll retrieves all users from database as an array of user
	FindAll() ([]model.User, error)
	// Update changes user information on the User.Id passed in.
	Update(user *model.User) (rowsAffected int64, err error)
	// Insert adds a user to a database. The returned resultUser has a Id, which is auto generated by database
	Insert(user *model.User) (resultUser *model.User, err error)
	// Add transaction support to the data interface
	txdataservice.TxDataInterface
}

UserDataInterface represents interface for user data access through database

Directories

Path Synopsis
userdata
couchdb
Package couchdb represents the CouchDB implementation of the user data persistence layer
Package couchdb represents the CouchDB implementation of the user data persistence layer
sqldb
Package sql represents SQL database implementation of the user data persistence layer
Package sql represents SQL database implementation of the user data persistence layer

Jump to

Keyboard shortcuts

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