methods

package
v0.0.0-...-36aee76 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LowercaseFirstRune

func LowercaseFirstRune(s string) string

LowercaseFirstRune lowercases first rune of string

Types

type BinaryFilterMethod

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

BinaryFilterMethod is a binary filter method

func NewBinaryFilterMethod

func NewBinaryFilterMethod(ctx QsFieldContext) BinaryFilterMethod

NewBinaryFilterMethod create new binary filter method

func (BinaryFilterMethod) GetArgsDeclaration

func (m BinaryFilterMethod) GetArgsDeclaration() string

GetArgsDeclaration returns declaration of arguments list for func decl

func (BinaryFilterMethod) GetBody

func (m BinaryFilterMethod) GetBody() string

func (BinaryFilterMethod) GetMethodName

func (m BinaryFilterMethod) GetMethodName() string

GetMethodName returns name of method

type CountMethod

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

CountMethod creates Count method

func NewCountMethod

func NewCountMethod(qsTypeName string) CountMethod

NewCountMethod returns new CountMethod

func (CountMethod) GetArgsDeclaration

func (m CountMethod) GetArgsDeclaration() string

GetArgsDeclaration returns declaration of arguments list for func decl

func (CountMethod) GetBody

func (m CountMethod) GetBody() string

GetBody returns const body

func (CountMethod) GetDoc

func (m CountMethod) GetDoc(methodName string) string

GetDoc returns default doc

func (CountMethod) GetMethodName

func (m CountMethod) GetMethodName() string

GetMethodName returns name of method

func (CountMethod) GetReturnValuesDeclaration

func (m CountMethod) GetReturnValuesDeclaration() string

type DeleteMethod

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

DeleteMethod creates Delete method

func NewDeleteMethod

func NewDeleteMethod(qsTypeName, structTypeName string) DeleteMethod

NewDeleteMethod creates Delete method

func (DeleteMethod) GetArgsDeclaration

func (m DeleteMethod) GetArgsDeclaration() string

GetArgsDeclaration returns declaration of arguments list for func decl

func (DeleteMethod) GetBody

func (m DeleteMethod) GetBody() string

GetBody returns body of method

func (DeleteMethod) GetDoc

func (m DeleteMethod) GetDoc(methodName string) string

GetDoc returns default doc

func (DeleteMethod) GetMethodName

func (m DeleteMethod) GetMethodName() string

GetMethodName returns name of method

type DeleteNumMethod

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

DeleteNumMethod creates DeleteNum method

func NewDeleteNumMethod

func NewDeleteNumMethod(qsTypeName, structTypeName string) DeleteNumMethod

NewDeleteNumMethod delete row count

func (DeleteNumMethod) GetArgsDeclaration

func (m DeleteNumMethod) GetArgsDeclaration() string

GetArgsDeclaration returns declaration of arguments list for func decl

func (DeleteNumMethod) GetBody

func (m DeleteNumMethod) GetBody() string

GetBody returns const body

func (DeleteNumMethod) GetDoc

func (m DeleteNumMethod) GetDoc(methodName string) string

GetDoc returns default doc

func (DeleteNumMethod) GetMethodName

func (m DeleteNumMethod) GetMethodName() string

GetMethodName returns name of method

func (DeleteNumMethod) GetReturnValuesDeclaration

func (m DeleteNumMethod) GetReturnValuesDeclaration() string

type DeleteNumUnscopedMethod

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

DeleteNumUnscopedMethod creates DeleteNumUnscoped method for performing hard deletes

func NewDeleteNumUnscopedMethod

func NewDeleteNumUnscopedMethod(qsTypeName, structTypeName string) DeleteNumUnscopedMethod

NewDeleteNumUnscopedMethod delete row count for hard deletes

func (DeleteNumUnscopedMethod) GetArgsDeclaration

func (m DeleteNumUnscopedMethod) GetArgsDeclaration() string

GetArgsDeclaration returns declaration of arguments list for func decl

func (DeleteNumUnscopedMethod) GetBody

func (m DeleteNumUnscopedMethod) GetBody() string

GetBody returns const body

func (DeleteNumUnscopedMethod) GetDoc

func (m DeleteNumUnscopedMethod) GetDoc(methodName string) string

GetDoc returns default doc

func (DeleteNumUnscopedMethod) GetMethodName

func (m DeleteNumUnscopedMethod) GetMethodName() string

GetMethodName returns name of method

func (DeleteNumUnscopedMethod) GetReturnValuesDeclaration

func (m DeleteNumUnscopedMethod) GetReturnValuesDeclaration() string

type FieldOperationNoArgsMethod

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

FieldOperationNoArgsMethod is for unary operations: preload, orderby, etc

func NewOrderAscByMethod

func NewOrderAscByMethod(ctx QsFieldContext) FieldOperationNoArgsMethod

NewOrderAscByMethod creates new OrderBy method ascending

func NewOrderDescByMethod

func NewOrderDescByMethod(ctx QsFieldContext) FieldOperationNoArgsMethod

NewOrderDescByMethod creates new OrderBy method descending

func NewPreloadMethod

func NewPreloadMethod(ctx QsFieldContext) FieldOperationNoArgsMethod

NewPreloadMethod creates new Preload method

func (FieldOperationNoArgsMethod) GetArgsDeclaration

func (m FieldOperationNoArgsMethod) GetArgsDeclaration() string

GetArgsDeclaration returns declaration of arguments list for func decl

func (FieldOperationNoArgsMethod) GetBody

func (m FieldOperationNoArgsMethod) GetBody() string

func (FieldOperationNoArgsMethod) GetMethodName

func (m FieldOperationNoArgsMethod) GetMethodName() string

GetMethodName returns name of method

type GetDBMethod

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

func NewGetDBMethod

func NewGetDBMethod(qsTypeName string) GetDBMethod

func (GetDBMethod) GetArgsDeclaration

func (m GetDBMethod) GetArgsDeclaration() string

GetArgsDeclaration returns declaration of arguments list for func decl

func (GetDBMethod) GetBody

func (m GetDBMethod) GetBody() string

GetBody returns const body

func (GetDBMethod) GetDoc

func (m GetDBMethod) GetDoc(methodName string) string

GetDoc returns default doc

func (GetDBMethod) GetMethodName

func (m GetDBMethod) GetMethodName() string

GetMethodName returns name of method

func (GetDBMethod) GetReturnValuesDeclaration

func (m GetDBMethod) GetReturnValuesDeclaration() string

type GetUpdaterMethod

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

GetUpdaterMethod creates GetUpdater method

func NewGetUpdaterMethod

func NewGetUpdaterMethod(qsTypeName, updaterTypeMethod string) GetUpdaterMethod

NewGetUpdaterMethod creates GetUpdaterMethod

func (GetUpdaterMethod) GetArgsDeclaration

func (m GetUpdaterMethod) GetArgsDeclaration() string

GetArgsDeclaration returns declaration of arguments list for func decl

func (GetUpdaterMethod) GetBody

func (m GetUpdaterMethod) GetBody() string

GetBody returns const body

func (GetUpdaterMethod) GetDoc

func (m GetUpdaterMethod) GetDoc(methodName string) string

GetDoc returns default doc

func (GetUpdaterMethod) GetMethodName

func (m GetUpdaterMethod) GetMethodName() string

GetMethodName returns name of method

func (GetUpdaterMethod) GetReturnValuesDeclaration

func (m GetUpdaterMethod) GetReturnValuesDeclaration() string

type InFilterMethod

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

InFilterMethod filters with IN condition

func NewInFilterMethod

func NewInFilterMethod(ctx QsFieldContext) InFilterMethod

NewInFilterMethod create new IN filter method

func NewNotInFilterMethod

func NewNotInFilterMethod(ctx QsFieldContext) InFilterMethod

NewNotInFilterMethod create new NOT IN filter method

func (InFilterMethod) GetArgsDeclaration

func (m InFilterMethod) GetArgsDeclaration() string

GetArgsDeclaration returns declaration of arguments list for func decl

func (InFilterMethod) GetBody

func (m InFilterMethod) GetBody() string

func (InFilterMethod) GetMethodName

func (m InFilterMethod) GetMethodName() string

GetMethodName returns name of method

type Method

type Method interface {
	GetMethodName() string
	GetReceiverDeclaration() string
	GetArgsDeclaration() string
	GetReturnValuesDeclaration() string
	GetBody() string
	GetDoc(methodName string) string
}

Method represents method (func with receiver)

type QsFieldContext

type QsFieldContext struct {
	QsStructContext
	// contains filtered or unexported fields
}

QsFieldContext is a query set field context

func (QsFieldContext) WithOperationName

func (ctx QsFieldContext) WithOperationName(operationName string) QsFieldContext

WithOperationName return ctx with changed operation's name

type QsStructContext

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

func NewQsStructContext

func NewQsStructContext(s parser.ParsedStruct) QsStructContext

func (QsStructContext) FieldCtx

func (ctx QsStructContext) FieldCtx(f field.Info) QsFieldContext

type SelectMethod

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

SelectMethod is a select field (all, one, etc)

func NewAllMethod

func NewAllMethod(structName, qsTypeName string) SelectMethod

NewAllMethod creates All method

func NewOneMethod

func NewOneMethod(structName, qsTypeName string) SelectMethod

NewOneMethod creates One method

func (SelectMethod) GetArgsDeclaration

func (m SelectMethod) GetArgsDeclaration() string

GetArgsDeclaration returns declaration of arguments list for func decl

func (SelectMethod) GetBody

func (m SelectMethod) GetBody() string

GetBody returns body of method

func (SelectMethod) GetDoc

func (m SelectMethod) GetDoc(methodName string) string

GetDoc returns default doc

func (SelectMethod) GetMethodName

func (m SelectMethod) GetMethodName() string

GetMethodName returns name of method

type StructModifierMethod

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

StructModifierMethod represents method, modifying current struct

func NewStructModifierMethod

func NewStructModifierMethod(name, structTypeName string) StructModifierMethod

NewStructModifierMethod create StructModifierMethod method

func (StructModifierMethod) GetBody

func (m StructModifierMethod) GetBody() string

GetBody returns body of method

func (StructModifierMethod) GetDoc

func (m StructModifierMethod) GetDoc(methodName string) string

GetDoc returns default doc

func (StructModifierMethod) GetMethodName

func (m StructModifierMethod) GetMethodName() string

GetMethodName returns name of method

type StructOperationOneArgMethod

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

StructOperationOneArgMethod is for struct operations with one arg

func NewLimitMethod

func NewLimitMethod(qsTypeName string) StructOperationOneArgMethod

NewLimitMethod creates Limit method

func NewOffsetMethod

func NewOffsetMethod(qsTypeName string) StructOperationOneArgMethod

NewOffsetMethod creates Offset method

func (StructOperationOneArgMethod) GetArgsDeclaration

func (m StructOperationOneArgMethod) GetArgsDeclaration() string

GetArgsDeclaration returns declaration of arguments list for func decl

func (StructOperationOneArgMethod) GetBody

func (m StructOperationOneArgMethod) GetBody() string

func (StructOperationOneArgMethod) GetDoc

func (m StructOperationOneArgMethod) GetDoc(methodName string) string

GetDoc returns default doc

func (StructOperationOneArgMethod) GetMethodName

func (m StructOperationOneArgMethod) GetMethodName() string

GetMethodName returns name of method

type UnaryFilterMethod

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

UnaryFilterMethod represents unary filter

func NewIsNotNullMethod

func NewIsNotNullMethod(ctx QsFieldContext) UnaryFilterMethod

NewIsNotNullMethod create IsNotNull method

func NewIsNullMethod

func NewIsNullMethod(ctx QsFieldContext) UnaryFilterMethod

NewIsNullMethod create IsNull method

func (UnaryFilterMethod) GetArgsDeclaration

func (m UnaryFilterMethod) GetArgsDeclaration() string

GetArgsDeclaration returns declaration of arguments list for func decl

func (UnaryFilterMethod) GetBody

func (m UnaryFilterMethod) GetBody() string

func (UnaryFilterMethod) GetMethodName

func (m UnaryFilterMethod) GetMethodName() string

GetMethodName returns name of method

type UpdaterSetMethod

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

UpdaterSetMethod generates Set<Field> method

func NewUpdaterSetMethod

func NewUpdaterSetMethod(fieldName, fieldTypeName,
	updaterTypeName, dbSchemaTypeName string) UpdaterSetMethod

NewUpdaterSetMethod create new SetField method

func (UpdaterSetMethod) GetArgsDeclaration

func (m UpdaterSetMethod) GetArgsDeclaration() string

GetArgsDeclaration returns declaration of arguments list for func decl

func (UpdaterSetMethod) GetBody

func (m UpdaterSetMethod) GetBody() string

GetBody returns const body

func (UpdaterSetMethod) GetMethodName

func (m UpdaterSetMethod) GetMethodName() string

GetMethodName returns name of method

func (UpdaterSetMethod) GetReturnValuesDeclaration

func (m UpdaterSetMethod) GetReturnValuesDeclaration() string

type UpdaterUpdateMethod

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

UpdaterUpdateMethod creates Update method

func NewUpdaterUpdateMethod

func NewUpdaterUpdateMethod(updaterTypeName string) UpdaterUpdateMethod

NewUpdaterUpdateMethod create new Update method

func (UpdaterUpdateMethod) GetArgsDeclaration

func (m UpdaterUpdateMethod) GetArgsDeclaration() string

GetArgsDeclaration returns declaration of arguments list for func decl

func (UpdaterUpdateMethod) GetBody

func (m UpdaterUpdateMethod) GetBody() string

GetBody returns const body

func (UpdaterUpdateMethod) GetDoc

func (m UpdaterUpdateMethod) GetDoc(methodName string) string

GetDoc returns default doc

func (UpdaterUpdateMethod) GetMethodName

func (m UpdaterUpdateMethod) GetMethodName() string

GetMethodName returns name of method

func (UpdaterUpdateMethod) GetReturnValuesDeclaration

func (m UpdaterUpdateMethod) GetReturnValuesDeclaration() string

type UpdaterUpdateNumMethod

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

UpdaterUpdateNumMethod describes UpdateNum method

func NewUpdaterUpdateNumMethod

func NewUpdaterUpdateNumMethod(updaterTypeName string) UpdaterUpdateNumMethod

NewUpdaterUpdateNumMethod creates new UpdateNum method

func (UpdaterUpdateNumMethod) GetArgsDeclaration

func (m UpdaterUpdateNumMethod) GetArgsDeclaration() string

GetArgsDeclaration returns declaration of arguments list for func decl

func (UpdaterUpdateNumMethod) GetBody

func (m UpdaterUpdateNumMethod) GetBody() string

GetBody returns const body

func (UpdaterUpdateNumMethod) GetDoc

func (m UpdaterUpdateNumMethod) GetDoc(methodName string) string

GetDoc returns default doc

func (UpdaterUpdateNumMethod) GetMethodName

func (m UpdaterUpdateNumMethod) GetMethodName() string

GetMethodName returns name of method

func (UpdaterUpdateNumMethod) GetReturnValuesDeclaration

func (m UpdaterUpdateNumMethod) GetReturnValuesDeclaration() string

Jump to

Keyboard shortcuts

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