project

package module
v0.0.0-...-322df4f Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2014 License: MIT Imports: 2 Imported by: 0

README

go-repositories

Some Go code for implementing Repositories for models.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(modelType interface{}) (interface{}, error)

Get returns the repository associated with the type of the provided model from the default Repository.

func Register

func Register(modelType, repo interface{})

Register the provided repository with the type uses the default Repository.

Types

type Repository

type Repository struct {
	// contains filtered or unexported fields
}

A Repository maintains a mapping between types and values.

func New

func New() *Repository

New Repository.

func (*Repository) Get

func (r *Repository) Get(modelType interface{}) (interface{}, error)

Get returns the repository associated with the type of the provided model returns an error if we can't find one.

func (*Repository) Register

func (r *Repository) Register(modelType, repo interface{})

Register associates the repo object with the type of modelType.

Jump to

Keyboard shortcuts

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