repository

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: May 30, 2019 License: Apache-2.0 Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseAll added in v0.1.4

func CloseAll(ctx context.Context) error

CloseAll closes all repositories

func RegisterFactory

func RegisterFactory(f Factory) error

RegisterFactory registers provided Factory within the container

Types

type Factory

type Factory interface {
	New(structer ModelStructer, model *mapping.ModelStruct) (Repository, error)
	Namer
	FactoryCloser
}

Factory is the interface used for creating the repositories

func GetFactory

func GetFactory(name string) Factory

GetFactory gets the repository factory

type FactoryCloser added in v0.1.4

type FactoryCloser interface {
	Close(ctx context.Context, done chan<- interface{})
}

FactoryCloser is the interface used to close the connections

type ModelStructer

type ModelStructer interface {
	ModelStruct(model interface{}) (*mapping.ModelStruct, error)
}

ModelStructer gets the model struct

type Namer added in v0.1.4

type Namer interface {
	RepositoryName() string
}

Namer is the interface that defines the repository name

type Repository

type Repository interface {
	Namer
	Close(ctx context.Context) error
}

Repository is the interface that defines the basic neuron Repository it may be extended by the interfaces from the scope package

func GetRepository

func GetRepository(structer ModelStructer, model interface{}) (Repository, error)

GetRepository gets the repository instance for the provided model

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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