base

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2019 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BaseTable

func BaseTable(object Base) (string, error)

func HashObject

func HashObject(object Base) (uint64, error)

func PreInsertion

func PreInsertion(object Base) error

func SetId added in v0.1.2

func SetId(object Base, newIdValue interface{}) error

Types

type Base

type Base interface{}

type BaseIdentifier added in v0.1.2

type BaseIdentifier struct {
	Column string
	Exists,
	IsSet bool
	Value interface{}
}

func GetId added in v0.1.2

func GetId(object Base) []BaseIdentifier

func InitializeId added in v0.1.2

func InitializeId(object Base) ([]BaseIdentifier, error)

type CompositeKey added in v0.1.2

type CompositeKey interface {
	CompositeKey() []string
}

type CustomTabler

type CustomTabler interface {
	TableName() string
}

type DatabaseFuncIDGenerator

type DatabaseFuncIDGenerator interface {
	DatabaseIDGenerationFunc() LiteralStatement
}

type DatabaseIDGenerator

type DatabaseIDGenerator interface {
	DatabaseGeneratedID()
}

type DatabaseManagedID

type DatabaseManagedID struct{}

func (DatabaseManagedID) DatabaseGeneratedID

func (DatabaseManagedID) DatabaseGeneratedID()

type IDColumner

type IDColumner interface {
	IDColumn() string
}

type IDGenerator

type IDGenerator interface {
	NewID() interface{}
}

type LiteralStatement

type LiteralStatement string

LiteralStatement is a string that will be directly inserted into a statement. Use great caution when using this as it will be vunerable to injection if not used properly.

type PostInserter

type PostInserter interface {
	PostInsertActions() error
}

type PreInserter

type PreInserter interface {
	PreInsertActions() error
}

type Relationship added in v0.1.2

type Relationship struct {
	// contains filtered or unexported fields
}

Relationship is a representation of how two objects join together.

func MustRelationship added in v0.1.2

func MustRelationship(
	self Base, selfColumn string, target Base, targetColumn string,
) Relationship

func NewRelationship added in v0.1.2

func NewRelationship(
	self Base, selfColumn string, target Base, targetColumn string,
) (*Relationship, error)

func (Relationship) Columns added in v0.1.2

func (self Relationship) Columns() (string, string)

func (Relationship) Invert added in v0.1.2

func (self Relationship) Invert() *Relationship

Invert takes the relationship and swaps the self with the target. This essentially has the effect of changing:

foo.bar=baz.fizz

Into:

baz.fizz=foo.bar

func (Relationship) Tables added in v0.1.2

func (self Relationship) Tables() (string, string)

func (Relationship) Types added in v0.1.2

func (self Relationship) Types() (reflect.Type, reflect.Type)

type Relationshipable added in v0.1.2

type Relationshipable interface {
	Relationships() []Relationship
}

Relationshipable is a type that has at least on relationship.

type Saveable

type Saveable interface {
	Saved() bool
	Save()
}

type TraditionalID

type TraditionalID interface {
	SetID(interface{}) error
	ID() (interface{}, bool)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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