db

package
v0.0.0-...-f0bbf45 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, factory DataStoreFactory)

Register saves data store into a data store factory

Types

type DataStore

type DataStore interface {
	AddStudent(student *models.Student) (string, error)
	GetStudent(id string) (*models.Student, error)
	DeleteStudent(id string) error
	UpdateStudent(student *models.Student) error
	AddTeacher(teacher *models.Teacher) (string, error)
	GetTeacher(id string) (*models.Teacher, error)
	DeleteTeacher(id string) error
	UpdateTeacher(teacher *models.Teacher) error
}

DataStore is an interface for query ops

type DataStoreFactory

type DataStoreFactory func(conf Option) (DataStore, error)

DataStoreFactory holds configuration for data store

type Option

type Option struct {
	TestMode bool
}

Option holds configuration for data store clients

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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