repository

package
v0.0.0-...-284eadf Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package repository contains interfaces used by our repositories.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckExists

func CheckExists(ctx context.Context, db *gorm.DB, tableName string, id string) error

CheckExists does the same as Exists but only returns the error value; thereby being a handy convenience function.

func Exists

func Exists(ctx context.Context, db *gorm.DB, tableName string, id string) (bool, error)

Exists returns true if an item exists in the database table with a given ID

Types

type Exister

type Exister interface {
	// Exists returns nil if the object with the given ID exists;
	// otherwise an error is returned in case the given ID doesn't exists or any
	// other unknown issue occured
	CheckExists(ctx context.Context, id string) error
}

Jump to

Keyboard shortcuts

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