typesutils

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2020 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AreEqual

func AreEqual(arg1, arg2 interface{}) (bool, error)

AreEqual returns true if both given values are equal.

func Convert added in v0.0.39

func Convert(value interface{}, target interface{}, isRS bool) error

Convert the given value to the given Type. Set isRS to true if the value represents a RecordSet

If the target type implements sql.Scanner, then the Scan method is used for the conversion.

func IsLessThan

func IsLessThan(arg1, arg2 interface{}) (bool, error)

IsLessThan returns true if arg1 is less than arg2 It panics if the kind of arg1 or arg2 is not a basic kind.

func IsZero

func IsZero(value interface{}) bool

IsZero returns true if the given value is the zero value of its type or nil

Types

type RecordSet

type RecordSet interface {
	// ModelName returns the name of the model of this RecordSet
	ModelName() string
	// Ids returns the ids in this set of Records
	Ids() []int64
	// Len returns the number of records in this RecordSet
	Len() int
	// IsEmpty returns true if this RecordSet has no records
	IsEmpty() bool
	// IsNotEmpty returns true if this RecordSet has at least one record
	IsNotEmpty() bool
}

RecordSet is an approximation of models.RecordSet so as not to import models.

Jump to

Keyboard shortcuts

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