Documentation ¶
Index ¶
Examples ¶
Constants ¶
View Source
const KCacheDir string = "./cache"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MetaJSonOut ¶
type MetaJSonOut struct { Cache string `json:"Cache,omitempty"` Limit int64 `json:"Limit,omitempty"` Next string `json:"Next,omitempty"` Offset int64 `json:"Offset"` Previous string `json:"Previous,omitempty"` TotalCount int `json:"TotalCount,omitempty"` Success bool `json:"Success"` Error []string `json:"Error,omitempty"` }
pt-br: monta a parte de meta-data do restful en: mount a mate-data from a restful data out
func (*MetaJSonOut) AddError ¶
func (el *MetaJSonOut) AddError(value string)
type Out ¶
type Out struct {
// contains filtered or unexported fields
}
func NewJSonOut ¶
func NewJSonOut() Out
pt-br: retorna um novo struct JSonOut para restful en: return a new JSonOut struct for restful
func (*Out) GetMachineName ¶
func (*Out) GetRandString ¶
func (*Out) SaveCache ¶
Example ¶
out := NewJSonOut() out.Id = "0000-0000-0000-0000" out.Meta.Success = true out.Meta.Limit = 30 out.Meta.Offset = 0 out.Meta.Next = "next.link" out.Meta.Previous = "previous.link" out.Objects = []string{"a", "b", "c"} err := out.SaveCache() if err != nil { panic(err) } id := out.Id out = NewJSonOut() err = out.LoadCache(id) if err != nil { panic(err) } fmt.Printf("%v\n", out)
Output: {{{ 30 next.link 0 previous.link 0 true []} [a b c]} 0000-0000-0000-0000}
Click to show internal directories.
Click to hide internal directories.