associations

package
v4.0.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SkippedAssociation = (Association)(nil)

SkippedAssociation an empty association used to indicate an association should not be queried.

Functions

This section is empty.

Types

type Association

type Association interface {
	Kind() reflect.Kind
	Interface() interface{}
	Constraint() (string, []interface{})
}

Association represents a definition of a model association field. It can represent a association of the type has_many belongs_to or has_one, and other customized types.

type AssociationSortable

type AssociationSortable interface {
	OrderBy() string
	Association
}

AssociationSortable a type to be sortable.

type Associations

type Associations []Association

Associations a group of model associations.

func AssociationsForStruct

func AssociationsForStruct(s interface{}, fields ...string) (Associations, error)

AssociationsForStruct returns all associations for the struct specified. It takes into account tags associations like has_many, belongs_to, has_one. it throws an error when it finds a field that does not exist for a model.

Jump to

Keyboard shortcuts

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