core

package module
v0.0.0-...-27a526a Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2018 License: Apache-2.0 Imports: 11 Imported by: 7

README

core-retrieval Build Status codecov.io

core-retrieval provides the models and services that are used across different Data Retrieval projects.

It uses a simple Dependency Injection Container configured with environment variables.

Generate models and schema

core-retrieval uses kallax as an ORM, and thus, it needs some code generation every time the models change. You can regenerate models by doing:

make generate-models

Or just:

go generate ./...

On top of that, the SQL schema of the models included in this package is bundled together as Go code using go-bindata. To regenerate the bindata of the schema, just run the following command:

make schema

There are some checks in the CI that prevent a build from suceeding if both the models and the schema are not generated.

License

Licensed under the terms of the Apache License Version 2.0. See the LICENSE file for the full license text.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Broker

func Broker() queue.Broker

Broker returns a queue.Broker for the default queue system.

func Database

func Database() *sql.DB

Database returns a sql.DB for the default database. If it is not possible to connect to the database, this function will panic. Multiple calls will always return the same instance.

func Locking

func Locking() lock.Service

Locking returns a lock.Service that can be used to acquire namespaced locks.

func ModelMentionStore

func ModelMentionStore() *model.MentionStore

ModelMentionStore returns the default *model.ModelMentionStore, using the default database. If it is not possible to connect to the database, this function will panic. Multiple calls will always return the same instance.

func ModelRepositoryStore

func ModelRepositoryStore() *model.RepositoryStore

ModelRepositoryStore returns the default *model.RepositoryStore, using the default database. If it is not possible to connect to the database, this function will panic. Multiple calls will always return the same instance.

func RootedTransactioner

func RootedTransactioner() repository.RootedTransactioner

RootedTransactioner returns the default RootedTransactioner instance, using the default RootRepositories directory. The local filesystem used to create the transactioner is the default TemporaryFilesystem from core container.

func TemporaryFilesystem

func TemporaryFilesystem() billy.Filesystem

TemporaryFilesystem returns a billy.Filesystem that can be used to store temporary files. This directory is dedicated to the running application.

Types

This section is empty.

Directories

Path Synopsis
Code generated by https://github.com/src-d/go-kallax.
Code generated by https://github.com/src-d/go-kallax.
Package repository implements services to work with Git repository storage.
Package repository implements services to work with Git repository storage.

Jump to

Keyboard shortcuts

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