Skip to content
zetaben edited this page Sep 14, 2010 · 1 revision

Models are based on go structures. Let’s use the following struct

type Personne struct {
        Nom string
        Id  int
        Age int
}

GoUDA can persist struct types that implements ModelInterface. There are two way to achieve this :

  • Implements all methods from the interface namely :
    • TableName() string
    • Identifier() string
  • Embed gouda.NullModel
    type Personne struct {
            Nom string
            Id  int
            Age int
            gouda.NullModel
    }
Clone this wiki locally