Documentation ¶
Index ¶
- func NewBsonTagNotFoundError(fieldName string) error
- func NewOperationNotSupportedError(operationName string) error
- func NewUpdateOperatorNotSupportedError(operator spec.UpdateOperator) error
- func NewUpdateTypeNotSupportedError(update spec.Update) error
- type RepositoryGenerator
- func (g RepositoryGenerator) GenerateConstructor() (codegen.FunctionBuilder, error)
- func (g RepositoryGenerator) GenerateMethod(methodSpec spec.MethodSpec) (codegen.MethodBuilder, error)
- func (g RepositoryGenerator) GenerateStruct() codegen.StructBuilder
- func (g RepositoryGenerator) Imports() [][]code.Import
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBsonTagNotFoundError ¶
NewBsonTagNotFoundError creates bsonTagNotFoundError
func NewOperationNotSupportedError ¶
NewOperationNotSupportedError creates operationNotSupportedError
func NewUpdateOperatorNotSupportedError ¶
func NewUpdateOperatorNotSupportedError(operator spec.UpdateOperator) error
NewUpdateOperatorNotSupportedError creates updateOperatorNotSupportedError
func NewUpdateTypeNotSupportedError ¶
NewUpdateTypeNotSupportedError creates updateTypeNotSupportedError
Types ¶
type RepositoryGenerator ¶
type RepositoryGenerator struct { InterfaceName string // contains filtered or unexported fields }
RepositoryGenerator is a MongoDB repository generator that provides necessary information required to construct an implementation.
func NewGenerator ¶
func NewGenerator(structModel code.Struct, interfaceName string) RepositoryGenerator
NewGenerator creates a new instance of MongoDB repository generator
func (RepositoryGenerator) GenerateConstructor ¶
func (g RepositoryGenerator) GenerateConstructor() (codegen.FunctionBuilder, error)
GenerateConstructor creates codegen.FunctionBuilder of a constructor for mongo repository implementation struct.
func (RepositoryGenerator) GenerateMethod ¶
func (g RepositoryGenerator) GenerateMethod(methodSpec spec.MethodSpec) (codegen.MethodBuilder, error)
GenerateMethod creates codegen.MethodBuilder of repository method from the provided method specification.
func (RepositoryGenerator) GenerateStruct ¶
func (g RepositoryGenerator) GenerateStruct() codegen.StructBuilder
GenerateStruct creates codegen.StructBuilder of mongo repository implementation struct.
func (RepositoryGenerator) Imports ¶
func (g RepositoryGenerator) Imports() [][]code.Import
Imports returns necessary imports for the mongo repository implementation.