base

package
v0.0.0-...-2d73068 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Overview

Package base 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 for a soft deletable item but only returns the error value; thereby being a handy convenience function.

func CheckExistsWithCustomIDColumn

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

CheckExistsWithCustomIDColumn does the same as CheckExists but allows to use custom ID column name instead of the default "id"

func CheckHardDeletableExists

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

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

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 occurred
	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