Documentation ¶
Index ¶
- Constants
- func FindArgumentMovedNotifications(db *gorm.DB) *gorm.DB
- func FindParentArgumentMovedNotifications(db *gorm.DB) *gorm.DB
- func InitTestDB() *gorm.DB
- func IntPtr(val int) *int
- func IsEmptyValue(v reflect.Value) bool
- func IsIdentifier(t reflect.Type) bool
- func IsValidator(t reflect.Type) bool
- func JsonToMap(jsonStr string) map[string]interface{}
- func JsonToMapArray(jsonStr string) []map[string]interface{}
- func JsonToModel(jsonStr string, item interface{}) error
- func ModelToJson(model interface{}) string
- func ModelToJsonMap(modl interface{}) map[string]interface{}
- func OpenTestConnection() (db *gorm.DB, err error)
- func OrderByBestArgument(db *gorm.DB) *gorm.DB
- func ParentCallerInfo() string
- func SetCreatedByID(item interface{}, id uint64) error
- func UintPtr(val uint64) *uint64
- type Argument
- func (a Argument) Arguments(ctx *ServerContext) (proArgs []Argument, conArgs []Argument)
- func (a *Argument) MoveTo(ctx *ServerContext, newId uuid.UUID, t int) GruffError
- func (a Argument) Score(ctx *ServerContext) float64
- func (a Argument) ScoreRU(ctx *ServerContext) float64
- func (a Argument) UpdateAncestorRUs(ctx *ServerContext)
- func (a Argument) UpdateStrength(ctx *ServerContext)
- func (a *Argument) UpdateStrengthRU(ctx *ServerContext)
- func (a Argument) ValidateField(f string) GruffError
- func (a Argument) ValidateForCreate() GruffError
- func (a Argument) ValidateForUpdate() GruffError
- func (a Argument) ValidateIDs() GruffError
- func (a Argument) ValidateType() GruffError
- type ArgumentOpinion
- type ChangeLog
- type Claim
- func (c Claim) Arguments(ctx *ServerContext) (proArgs []Argument, conArgs []Argument)
- func (c Claim) UpdateAncestorRUs(ctx *ServerContext)
- func (c Claim) UpdateTruth(ctx *ServerContext)
- func (c *Claim) UpdateTruthRU(ctx *ServerContext)
- func (c Claim) ValidateField(f string) GruffError
- func (c Claim) ValidateForCreate() GruffError
- func (c Claim) ValidateForUpdate() GruffError
- type ClaimOpinion
- type Context
- type CoreError
- type GruffError
- func NewBusinessError(msg string, opts ...interface{}) GruffError
- func NewGruffError(code, subcode int, location, msg string, data map[string]interface{}) GruffError
- func NewNotFoundError(msg string, opts ...interface{}) GruffError
- func NewPermissionError(msg string, opts ...interface{}) GruffError
- func NewServerError(msg string, opts ...interface{}) GruffError
- func NewUnauthorizedError(msg string, opts ...interface{}) GruffError
- func NewWarning(msg string, opts ...interface{}) GruffError
- func NotifyArgumentMoved(ctx *ServerContext, userId uint64, argId uuid.UUID, oldTargetId uuid.UUID, ...) GruffError
- func NotifyNewArgument(ctx ServerContext, userId uint64, item interface{}, newArg Argument) GruffError
- func NotifyParentArgumentMoved(ctx *ServerContext, userId uint64, parentArgId uuid.UUID, ...) GruffError
- func ValidateRequiredFields(item interface{}, fields []string) GruffError
- func ValidateStruct(item interface{}) GruffError
- func ValidateStructField(item interface{}, f string) GruffError
- func ValidateStructFields(item interface{}) GruffError
- type Identifier
- type Link
- type Model
- type Notification
- type NullableUUID
- type ServerContext
- type Tag
- type User
- type Validator
- type Value
Constants ¶
const ARGUMENT_TYPE_CON_STRENGTH int = 4
const ARGUMENT_TYPE_CON_TRUTH int = 2
const ARGUMENT_TYPE_PRO_STRENGTH int = 3
const ARGUMENT_TYPE_PRO_TRUTH int = 1
const CHANGE_TYPE_CLONE_CLAIM int = 21
const CHANGE_TYPE_CREATED_ARGUMENT int = 2
const CHANGE_TYPE_CREATED_CLAIM int = 1
const CHANGE_TYPE_CREATED_CLAIM_AND_ARGUMENT int = 3
const CHANGE_TYPE_MERGE_ARGUMENTS int = 32
const CHANGE_TYPE_MERGE_CLAIMS int = 31
const CHANGE_TYPE_MOVED_ARGUMENT int = 11
const ERROR_CODE_BUSINESS_ERROR int = 400
const ERROR_CODE_NOT_FOUND int = 404
const ERROR_CODE_PERMISSION_ERROR int = 403
const ERROR_CODE_SERVER_ERROR int = 500
const ERROR_CODE_UNAUTHORIZED_ERROR int = 401
const ERROR_CODE_WARNING int = 300
const ERROR_SUBCODE_CREDENTIALS_INVALID int = -2009
const ERROR_SUBCODE_EMAIL_FORMAT int = -2006
const ERROR_SUBCODE_EMAIL_TAKEN int = -2005
const ERROR_SUBCODE_PASSWORD_FORMAT int = -2008
const ERROR_SUBCODE_PASSWORD_LENGTH int = -2007
const ERROR_SUBCODE_UNDEFINED int = -1999
const ERROR_SUBCODE_UNDEFINED_IGNORE int = -1000
const ERROR_SUBCODE_USERNAME_FORMAT int = -2004
const ERROR_SUBCODE_USERNAME_LENGTH int = -2003
const ERROR_SUBCODE_USERNAME_TAKEN int = -2002
const NOTIFICATION_TYPE_MOVED int = 1
const NOTIFICATION_TYPE_NEW_ARGUMENT int = 3
const NOTIFICATION_TYPE_PARENT_MOVED int = 2
const OBJECT_TYPE_ARGUMENT int = 2
const OBJECT_TYPE_CLAIM int = 1
Variables ¶
This section is empty.
Functions ¶
func InitTestDB ¶
func IsEmptyValue ¶
func IsIdentifier ¶
func IsValidator ¶
func JsonToMapArray ¶
func JsonToModel ¶
func ModelToJson ¶
func ModelToJson(model interface{}) string
func ModelToJsonMap ¶
func ModelToJsonMap(modl interface{}) map[string]interface{}
func OpenTestConnection ¶
func ParentCallerInfo ¶
func ParentCallerInfo() string
func SetCreatedByID ¶
Types ¶
type Argument ¶
type Argument struct { Identifier TargetClaimID *NullableUUID `json:"targetClaimId,omitempty" sql:"type:uuid"` TargetClaim *Claim `json:"targetClaim,omitempty"` TargetArgumentID *NullableUUID `json:"targetArgId,omitempty" sql:"type:uuid"` TargetArgument *Argument `json:"targetArg,omitempty"` ClaimID uuid.UUID `json:"claimId" sql:"type:uuid;not null"` Claim *Claim `json:"claim,omitempty"` Title string `json:"title" sql:"not null" valid:"length(3|1000),required"` Description string `json:"desc" valid:"length(3|4000)"` Type int `json:"type" sql:"not null"` Strength float64 `json:"strength"` StrengthRU float64 `json:"strengthRU"` ProStrength []Argument `json:"prostr,omitempty"` ConStrength []Argument `json:"constr,omitempty"` }
An Argument connects a Claim to another Claim or Argument That is: a Claim can be used as an ARGUMENT to either prove or disprove the truth of a claim, or to modify the relevance or impact of another argument. The TYPE of the argument indicates how the claim (or CLAIM) is being used: PRO TRUTH: The Claim is a claim that is being used to prove the truth of another claim Ex: "The defendant was in Cincinatti on the date of the murder" CON TRUTH: The Claim is used as evidence against another claim Ex: "The defendant was hospitalized on the date of the murder" PRO RELEVANCE: The Claim is being used to show that another Argument is relevant Ex: "The murder occurred in Cincinatti" CON RELEVANCE: The Claim is being used to show that another Argument is irrelevant Ex: "The murder occurred in the same hospital in which the defendant was hospitalized" PRO IMPACT: The Claim is being used to show the importance of another Argument Ex: "This argument clearly shows that the defendant has no alibi" CON IMPACT: The Claim is being used to diminish the importance of another argument Ex: "There is no evidence that the defendant ever left their room" A quick explanation of the fields: Claim: The Debate (or claim) that is being used as an argument Target Claim: The "parent" Claim against which a pro/con truth argument is being made Target Argument: In the case of a relevance or impact argument, the argument to which it refers To help understand the difference between relevance and impact arguments, imagine an argument is a bullet: Impact is the size of your bullet Relevance is how well you hit your target Scoring: Truth: 1.0 = definitely true; 0.5 = equal chance true or false; 0.0 = definitely false. "The world is flat" should have a 0.000000000000000001 truth score. Impact: 1.0 = This argument is definitely the most important argument for this side - no need to read any others; 0.5 = This is one more argument to consider; 0.01 = Probably not even worth including in the discussion Relevance: 1.0 = Completely germaine and on-topic; 0.5 = Circumstantial or somewhat relevant; 0.01 = Totally off-point, should be ignored
* * Topoi for Resolutions of Definition (for scoring Relevance/Impact): * - Is the interpretation relevant? (relevance) * - Is the interpretation fair? * - How should we choose among competing interpretations? (impact) * * Topoi for Resolutions of Value (for scoring Relevance/Impact): * - Is the condition truly good or bad as alleged? (i.e. which values are impacted, and is it positive or negative?) * - Has the value been properly applied? (relevance) * - How should we choose among competing values? (impact) * * Topoi for Resolutions of Policy (this would look differently in our model - one Issue with multiple claims as solutions?): * - Is there a problem? (could be represented by a "Do nothing" claim) * - Where is the credit or blame due? * - Will the proposal solve the problem? * - On balance, will things be better off? (trade offs - need to measure each proposal against multiple values) *
* Types of evidence (Pro/Con-Truth arguments) (not implemented in Gruff): * - Examples * - Statistics * - Tangible objects * - Testimony * - Social consensus
* Fallacies: accusations of standard fallacies can be used as arguments against relevance, impact, or truth * - Fallacies of Inference (con-impact? or con-relevance?): * - Hasty generalizations * - Unrepresentative samples * - Fallacy of composition (if one is, then all are) * - Fallacy of division (if most are, then this subgroup must be) * - Errors in inference from sign (correlation vs. causation) * * - Fallacies of Relevance: * - Ad Hominem * - Appeal to Unreasonable Emotion * ... more
--> True definition of fallacy: an argument that subverts the purpose of resolving a disagreement
func (Argument) Arguments ¶
func (a Argument) Arguments(ctx *ServerContext) (proArgs []Argument, conArgs []Argument)
func (*Argument) MoveTo ¶
func (a *Argument) MoveTo(ctx *ServerContext, newId uuid.UUID, t int) GruffError
func (Argument) Score ¶
func (a Argument) Score(ctx *ServerContext) float64
func (Argument) ScoreRU ¶
func (a Argument) ScoreRU(ctx *ServerContext) float64
func (Argument) UpdateAncestorRUs ¶
func (a Argument) UpdateAncestorRUs(ctx *ServerContext)
func (Argument) UpdateStrength ¶
func (a Argument) UpdateStrength(ctx *ServerContext)
func (*Argument) UpdateStrengthRU ¶
func (a *Argument) UpdateStrengthRU(ctx *ServerContext)
func (Argument) ValidateField ¶
func (a Argument) ValidateField(f string) GruffError
func (Argument) ValidateForCreate ¶
func (a Argument) ValidateForCreate() GruffError
func (Argument) ValidateForUpdate ¶
func (a Argument) ValidateForUpdate() GruffError
func (Argument) ValidateIDs ¶
func (a Argument) ValidateIDs() GruffError
func (Argument) ValidateType ¶
func (a Argument) ValidateType() GruffError
type ArgumentOpinion ¶
type ArgumentOpinion struct { Model UserID uint64 `json:"userId"` User *User `json:"user,omitempty"` ArgumentID uuid.UUID `json:"argumentId" sql:"type:uuid"` Argument *Argument `json:"argument,omitempty"` Strength float64 `json:"strength"` }
func (ArgumentOpinion) ValidateField ¶
func (ao ArgumentOpinion) ValidateField(f string) GruffError
func (ArgumentOpinion) ValidateForCreate ¶
func (ao ArgumentOpinion) ValidateForCreate() GruffError
func (ArgumentOpinion) ValidateForUpdate ¶
func (ao ArgumentOpinion) ValidateForUpdate() GruffError
type ChangeLog ¶
type ChangeLog struct { Model UserID uint64 `json:"userId" sql:"not null"` User *User `json:"user,omitempty"` Type int `json:"type" sql:"not null"` ArgumentID *NullableUUID `json:"argumentId,omitempty" sql:"type:uuid"` Argument *Argument `json:"argument,omitempty"` ClaimID *NullableUUID `json:"claimId,omitempty" sql:"type:uuid"` Claim Claim `json:"claim"` OldClaimID *NullableUUID `json:"oldClaimId,omitempty" sql:"type:uuid"` OldClaim *Claim `json:"oldClaim,omitempty"` OldArgID *NullableUUID `json:"oldArgId,omitempty" sql:"type:uuid"` OldArg *Argument `json:"oldArg,omitempty"` NewClaimID *NullableUUID `json:"newClaimId,omitempty" sql:"type:uuid"` NewClaim *Claim `json:"newClaim,omitempty"` NewArgID *NullableUUID `json:"newArgId,omitempty" sql:"type:uuid"` NewArg *Argument `json:"newArg,omitempty"` OldArgType *int `json:"oldArgType,omitempty"` NewArgType *int `json:"newArgType,omitempty"` }
Types of Changes, and fields used: - Created Claim: ClaimID - Created Argument: ArgumentID, NewArgType, NewClaimID or NewArgID (parent) - Created Claim and Argument: ArgumentID, NewArgType, NewClaimID or NewArgID (parent) - Moved Argument: ArgumentID, OldClaimID or OldArgID, NewClaimID or NewArgID (parent), OldArgType, NewArgType - Clone Claim:
- One claim stays
- New claim created, with same values, context, title and description (must be changed before saving)
- Arguments stay with main claim --> Need Change Type add/remove values and contexts --> ClaimID, NewClaimID --> What about opinions?? I guess it would make a copy --> Would there be arguments between old and new claim(s)? ------- E.g. Fidel Castro is nice, and ended Apartheid --> Fidel Castro is nice, Fidel Castro ended Apartheid
- Merge Claims:
- One claim becomes defunct
- Must have "compatible" values/context (TBD)
- All arguments attach to "winning" claim
- Title, description stick with "winning" claim
- All arguments with "losing" claim as base reattach to "winning" claim
- Do we need a change log for each of these? Probably...
- What about opinions? Should also merge...
func (ChangeLog) ValidateField ¶
func (cl ChangeLog) ValidateField(f string) GruffError
func (ChangeLog) ValidateForCreate ¶
func (cl ChangeLog) ValidateForCreate() GruffError
func (ChangeLog) ValidateForUpdate ¶
func (cl ChangeLog) ValidateForUpdate() GruffError
type Claim ¶
type Claim struct { Identifier Title string `json:"title" sql:"not null" valid:"length(3|1000)"` Description string `json:"desc" valid:"length(3|4000)"` Truth float64 `json:"truth"` TruthRU float64 `json:"truthRU"` // Average score rolled up from argument totals ProTruth []Argument `json:"protruth,omitempty"` ConTruth []Argument `json:"contruth,omitempty"` Links []Link `json:"links,omitempty"` Contexts []Context `json:"contexts,omitempty" gorm:"many2many:claim_contexts;"` ContextIDs []uint64 `json:"contextIds,omitempty" gorm:"-"` Values []Value `json:"values,omitempty" gorm:"many2many:claim_values;"` Tags []Tag `json:"tags,omitempty" gorm:"many2many:claim_tags;"` }
* A Claim is a proposed statement of fact * * According to David Zarefsky (https://www.thegreatcoursesplus.com/argumentation/argument-analysis-and-diagramming) there are 4 types: * - Fact: Al Gore received more popular votes than George Bush in the 2000 election * - Definition: Capital execution is murder * - Value: Environmental protection is more important than economic growth * - Policy: Congress should pass the president's budget * * Also according to the professor, there are 4 parts to a claim/argument: * - Claim * - Evidence * - Inference * - Warrant * * In loose terms, a Claim here represents his Claim, and Evidence * An Argument of type 1 or 2 (truth) is an Inference * An Argument of type 3, 4, 5 or 6 is a Warrant * * Complex Claims: * - Series: Because of X, Y happened, which caused Z --> Not modeled in Gruff * - Convergent: Airline travel is becoming more unpleasant because of X, Y, Z, P, D, and Q --> Supported by standard Gruff structure * - Parallel: Same as convergent, except that any one argument is enough --> Supported by standard Gruff structure * * Topoi for Resolutions of Fact (for scoring Truth): * - What are the criteria (of truth)? * - Are the criteria satisfied?
func (Claim) Arguments ¶
func (c Claim) Arguments(ctx *ServerContext) (proArgs []Argument, conArgs []Argument)
func (Claim) UpdateAncestorRUs ¶
func (c Claim) UpdateAncestorRUs(ctx *ServerContext)
func (Claim) UpdateTruth ¶
func (c Claim) UpdateTruth(ctx *ServerContext)
func (*Claim) UpdateTruthRU ¶
func (c *Claim) UpdateTruthRU(ctx *ServerContext)
func (Claim) ValidateField ¶
func (c Claim) ValidateField(f string) GruffError
func (Claim) ValidateForCreate ¶
func (c Claim) ValidateForCreate() GruffError
func (Claim) ValidateForUpdate ¶
func (c Claim) ValidateForUpdate() GruffError
type ClaimOpinion ¶
type ClaimOpinion struct { Model UserID uint64 `json:"userId"` User *User `json:"user,omitempty"` ClaimID uuid.UUID `json:"claimId" sql:"type:uuid"` Claim *Claim `json:"claim,omitempty"` Truth float64 `json:"truth"` }
func (ClaimOpinion) ValidateField ¶
func (co ClaimOpinion) ValidateField(f string) GruffError
func (ClaimOpinion) ValidateForCreate ¶
func (co ClaimOpinion) ValidateForCreate() GruffError
func (ClaimOpinion) ValidateForUpdate ¶
func (co ClaimOpinion) ValidateForUpdate() GruffError
type Context ¶
type Context struct { Model ParentID *uint64 `json:"parentId"` Parent *Context `json:"parent,omitempty"` Title string `json:"title" sql:"not null" valid:"length(3|1000)"` Description string `json:"desc" valid:"length(3|4000)"` Url string `json:"url" valid:"url,required"` MID string `json:"mid"` // Google KG ID QID string `json:"qid"` // Wikidata ID }
func (Context) ValidateField ¶
func (c Context) ValidateField(f string) GruffError
func (Context) ValidateForCreate ¶
func (c Context) ValidateForCreate() GruffError
func (Context) ValidateForUpdate ¶
func (c Context) ValidateForUpdate() GruffError
type CoreError ¶
type GruffError ¶
type GruffError interface { Code() int Subcode() int Error() string Location() string Data() map[string]interface{} IsWarning() bool }
func NewBusinessError ¶
func NewBusinessError(msg string, opts ...interface{}) GruffError
func NewGruffError ¶
func NewGruffError(code, subcode int, location, msg string, data map[string]interface{}) GruffError
func NewNotFoundError ¶
func NewNotFoundError(msg string, opts ...interface{}) GruffError
func NewPermissionError ¶
func NewPermissionError(msg string, opts ...interface{}) GruffError
func NewServerError ¶
func NewServerError(msg string, opts ...interface{}) GruffError
func NewUnauthorizedError ¶
func NewUnauthorizedError(msg string, opts ...interface{}) GruffError
func NewWarning ¶
func NewWarning(msg string, opts ...interface{}) GruffError
func NotifyArgumentMoved ¶
func NotifyArgumentMoved(ctx *ServerContext, userId uint64, argId uuid.UUID, oldTargetId uuid.UUID, oldTargetType int) GruffError
func NotifyNewArgument ¶
func NotifyNewArgument(ctx ServerContext, userId uint64, item interface{}, newArg Argument) GruffError
func NotifyParentArgumentMoved ¶
func NotifyParentArgumentMoved(ctx *ServerContext, userId uint64, parentArgId uuid.UUID, oldTargetId uuid.UUID, oldTargetType int) GruffError
func ValidateRequiredFields ¶
func ValidateRequiredFields(item interface{}, fields []string) GruffError
func ValidateStruct ¶
func ValidateStruct(item interface{}) GruffError
func ValidateStructField ¶
func ValidateStructField(item interface{}, f string) GruffError
func ValidateStructFields ¶
func ValidateStructFields(item interface{}) GruffError
type Identifier ¶
type Identifier struct { ID uuid.UUID `json:"uuid" sql:"type:uuid;default:uuid_generate_v4()"` CreatedAt time.Time `json:"-" sql:"DEFAULT:current_timestamp"` UpdatedAt time.Time `json:"-" sql:"DEFAULT:current_timestamp"` DeletedAt *time.Time `json:"-" settable:"false"` CreatedByID uint64 `json:"createdById"` CreatedBy *User `json:"createdBy"` }
func (*Identifier) GenerateUUID ¶
func (i *Identifier) GenerateUUID() uuid.UUID
func (Identifier) ValidateField ¶
func (i Identifier) ValidateField(f string) GruffError
func (Identifier) ValidateForCreate ¶
func (i Identifier) ValidateForCreate() GruffError
func (Identifier) ValidateForUpdate ¶
func (i Identifier) ValidateForUpdate() GruffError
type Link ¶
type Link struct { Identifier Title string `json:"title" sql:"not null" valid:"length(3|1000)"` Description string `json:"desc" valid:"length(3|4000)"` Url string `json:"url" valid:"length(3|4000)"` ClaimID uuid.UUID `json:"claimId" sql:"type:uuid;not null"` Claim *Claim `json:"claim,omitempty"` }
func (Link) ValidateField ¶
func (l Link) ValidateField(f string) GruffError
func (Link) ValidateForCreate ¶
func (l Link) ValidateForCreate() GruffError
func (Link) ValidateForUpdate ¶
func (l Link) ValidateForUpdate() GruffError
type Notification ¶
type Notification struct { Model UserID uint64 `json:"userId" sql:"not null"` Type int `json:"type" sql:"not null"` ItemID *NullableUUID `json:"itemId,omitempty" sql:"type:uuid"` ItemType *int `json:"itemType"` Item interface{} `json:"item,omitempty" gorm:"-"` OldID *NullableUUID `json:"oldId,omitempty" sql:"type:uuid"` OldType *int `json:"oldType"` NewID *NullableUUID `json:"newId,omitempty" sql:"type:uuid"` NewType *int `json:"newType"` Viewed bool `json:"viewed" sql:"not null"` }
func (Notification) ValidateField ¶
func (n Notification) ValidateField(f string) GruffError
func (Notification) ValidateForCreate ¶
func (n Notification) ValidateForCreate() GruffError
func (Notification) ValidateForUpdate ¶
func (n Notification) ValidateForUpdate() GruffError
type NullableUUID ¶
NullableUUID wrapper to fix nullable UUID. See https://github.com/golang/go/issues/8415
func NUUID ¶
func NUUID(id uuid.UUID) *NullableUUID
func NewNUUID ¶
func NewNUUID() *NullableUUID
func (*NullableUUID) MarshalText ¶
func (u *NullableUUID) MarshalText() ([]byte, error)
MarshalText helps convert to value for JSON
func (*NullableUUID) Scan ¶
func (u *NullableUUID) Scan(value interface{}) error
Setting from DB via Gorm
func (*NullableUUID) UnmarshalText ¶
func (u *NullableUUID) UnmarshalText(data []byte) error
UnmarshalText helps convert to value for JSON
type ServerContext ¶
type Tag ¶
func (Tag) ValidateField ¶
func (t Tag) ValidateField(f string) GruffError
func (Tag) ValidateForCreate ¶
func (t Tag) ValidateForCreate() GruffError
func (Tag) ValidateForUpdate ¶
func (t Tag) ValidateForUpdate() GruffError
type User ¶
type User struct { Model Name string `json:"name" sql:"not null" valid:"length(3|50)"` Username string `json:"username" settable:"false" sql:"unique_index;not null" valid:"length(3|50),matches(^[a-zA-Z0-9][a-zA-Z0-9-_]+$)"` Email string `json:"email" sql:"not null" valid:"email"` Password string `json:"password,omitempty" sql:"-" valid:"length(5|64)"` HashedPassword []byte `json:"-" sql:"hashed_password;not null" gorm:"size:32"` Image string `json:"img,omitempty"` Curator bool `json:"curator"` Admin bool `json:"admin"` EmailVerifiedAt *time.Time `json:"-" settable:"false"` }
func (User) ValidateField ¶
func (u User) ValidateField(f string) GruffError
func (User) ValidateForCreate ¶
func (u User) ValidateForCreate() GruffError
func (User) ValidateForUpdate ¶
func (u User) ValidateForUpdate() GruffError
type Validator ¶
type Validator interface { ValidateForCreate() GruffError ValidateForUpdate() GruffError ValidateField(string) GruffError }
type Value ¶
type Value struct { Model ParentID *uint64 `json:"parentId"` Parent *Value `json:"parent,omitempty"` Title string `json:"title" sql:"not null" valid:"length(3|1000)"` Description string `json:"desc" valid:"length(3|4000)"` }
func (Value) ValidateField ¶
func (v Value) ValidateField(f string) GruffError
func (Value) ValidateForCreate ¶
func (v Value) ValidateForCreate() GruffError
func (Value) ValidateForUpdate ¶
func (v Value) ValidateForUpdate() GruffError