code

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2018 License: BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteDeleteFunc

func WriteDeleteFunc(w io.Writer, view View)

func WriteExecFunc

func WriteExecFunc(w io.Writer, view View)

func WriteGetRow

func WriteGetRow(w io.Writer, view View)

func WriteImports

func WriteImports(w io.Writer, table *schema.TableDescription, setters schema.FieldList, packages StringSet)

func WriteInsertFunc

func WriteInsertFunc(w io.Writer, view View)

func WritePackage

func WritePackage(w io.Writer, name string)

WritePackage writes the Go package header to writer w with the given package name.

func WriteQueryFuncs

func WriteQueryFuncs(w io.Writer, view View)

func WriteRowsFunc

func WriteRowsFunc(w io.Writer, view View)

func WriteSchema

func WriteSchema(w io.Writer, view View)

writeSchema writes SQL statements to CREATE, INSERT, UPDATE and DELETE values from Table t.

func WriteSelectRowsFuncs added in v0.8.0

func WriteSelectRowsFuncs(w io.Writer, view View)

func WriteSetters added in v0.8.0

func WriteSetters(w io.Writer, view View, fields schema.FieldList)

func WriteSliceColumn added in v0.8.0

func WriteSliceColumn(w io.Writer, view View)

func WriteSliceFunc

func WriteSliceFunc(w io.Writer, view View, withoutPk bool)

func WriteType

func WriteType(w io.Writer, view View)

func WriteUpdateFunc

func WriteUpdateFunc(w io.Writer, view View)

Types

type ConstView

type ConstView struct {
	Name string
	Body interface{}
}

type SetterView added in v0.8.0

type SetterView struct {
	Type   string
	Setter *schema.Field
}

type StringSet

type StringSet map[string]struct{}

StringSet is the primary type that represents a set

func ConvertStringSet

func ConvertStringSet(values ...interface{}) (StringSet, bool)

ConvertStringSet constructs a new set containing the supplied values, if any. The returned boolean will be false if any of the values could not be converted correctly.

func NewStringSet

func NewStringSet(values ...string) StringSet

NewStringSet creates and returns a reference to an empty set.

func (StringSet) Add

func (set StringSet) Add(i ...string) StringSet

Add adds items to the current set, returning the modified set.

func (StringSet) Append

func (set StringSet) Append(more ...string) StringSet

Union returns a new set with all items in both sets.

func (*StringSet) Clear

func (set *StringSet) Clear()

Clear clears the entire set to be the empty set.

func (StringSet) Clone

func (set StringSet) Clone() StringSet

Clone returns a shallow copy of the map. It does not clone the underlying elements.

func (StringSet) Contains

func (set StringSet) Contains(i string) bool

Contains determines if a given item is already in the set.

func (StringSet) ContainsAll

func (set StringSet) ContainsAll(i ...string) bool

ContainsAll determines if the given items are all in the set

func (StringSet) Difference

func (set StringSet) Difference(other StringSet) StringSet

Difference returns a new set with items in the current set but not in the other set

func (StringSet) Equals

func (set StringSet) Equals(other StringSet) bool

Equals determines if two sets are equal to each other. If they both are the same size and have the same items they are considered equal. Order of items is not relevent for sets to be equal.

func (StringSet) Intersect

func (set StringSet) Intersect(other StringSet) StringSet

Intersect returns a new set with items that exist only in both sets.

func (StringSet) IsEmpty

func (set StringSet) IsEmpty() bool

IsEmpty returns true if the set is empty.

func (StringSet) IsSubset

func (set StringSet) IsSubset(other StringSet) bool

IsSubset determines if every item in the other set is in this set.

func (StringSet) IsSuperset

func (set StringSet) IsSuperset(other StringSet) bool

IsSuperset determines if every item of this set is in the other set.

func (StringSet) MarshalJSON

func (set StringSet) MarshalJSON() ([]byte, error)

implements encoding.Marshaler interface {

func (StringSet) MkString

func (set StringSet) MkString(sep string) string

MkString concatenates the values as a string using a supplied separator. No enclosing marks are added.

func (StringSet) MkString3

func (set StringSet) MkString3(pfx, mid, sfx string) string

MkString3 concatenates the values as a string, using the prefix, separator and suffix supplied.

func (StringSet) NonEmpty

func (set StringSet) NonEmpty() bool

NonEmpty returns true if the set is not empty.

func (StringSet) Remove

func (set StringSet) Remove(i string)

Remove allows the removal of a single item from the set.

func (StringSet) Size

func (set StringSet) Size() int

Size returns how many items are currently in the set. This is a synonym for Cardinality.

func (StringSet) String

func (set StringSet) String() string

func (StringSet) StringList

func (set StringSet) StringList() []string

func (StringSet) StringMap

func (set StringSet) StringMap() map[string]bool

StringMap renders the set as a map of strings. The value of each item in the set becomes stringified as a key in the resulting map.

func (StringSet) SymmetricDifference

func (set StringSet) SymmetricDifference(other StringSet) StringSet

SymmetricDifference returns a new set with items in the current set or the other set but not in both.

func (StringSet) ToInterfaceSlice

func (set StringSet) ToInterfaceSlice() []interface{}

ToInterfaceSlice returns the elements of the current set as a slice of arbitrary type.

func (StringSet) ToSlice

func (set StringSet) ToSlice() []string

ToSlice returns the elements of the current set as a slice.

func (StringSet) Union

func (set StringSet) Union(other StringSet) StringSet

Union returns a new set with all items in both sets.

type View

type View struct {
	Prefix    string
	Type      string
	Types     string
	Thing     string
	Interface string
	List      string
	Suffix    string
	Body1     []string
	Body2     []string
	Body3     []string
	Dialects  []string
	Table     *schema.TableDescription
	Setter    *schema.Field
}

func NewView

func NewView(name, prefix, list string) View

func (View) CamelName added in v0.8.1

func (v View) CamelName() string

func (View) DbName

func (v View) DbName() string

func (View) FilterSetters added in v0.8.0

func (v View) FilterSetters(genSetters string) schema.FieldList

Jump to

Keyboard shortcuts

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