jirfag/go-queryset

View on GitHub
internal/queryset/methods/struct.go

Summary

Maintainability
A
0 mins
Test Coverage
package methods

// StructModifierMethod represents method, modifying current struct
type StructModifierMethod struct {
    namedMethod
    structMethod
    dbArgMethod
    gormErroredMethod
}

// NewStructModifierMethod create StructModifierMethod method
func NewStructModifierMethod(name, structTypeName string) StructModifierMethod {
    r := StructModifierMethod{
        namedMethod:       newNamedMethod(name),
        dbArgMethod:       newDbArgMethod(),
        structMethod:      newStructMethod("o", "*"+structTypeName),
        gormErroredMethod: newGormErroredMethod(name, "o", "db"),
    }
    return r
}