github.com/wgh-/mattermost-server@v4.8.0-rc2+incompatible/model/initial_load.go (about) 1 // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. 2 // See License.txt for license information. 3 4 package model 5 6 import ( 7 "encoding/json" 8 "io" 9 ) 10 11 type InitialLoad struct { 12 User *User `json:"user"` 13 TeamMembers []*TeamMember `json:"team_members"` 14 Teams []*Team `json:"teams"` 15 Preferences Preferences `json:"preferences"` 16 ClientCfg map[string]string `json:"client_cfg"` 17 LicenseCfg map[string]string `json:"license_cfg"` 18 NoAccounts bool `json:"no_accounts"` 19 } 20 21 func (me *InitialLoad) ToJson() string { 22 b, _ := json.Marshal(me) 23 return string(b) 24 } 25 26 func InitialLoadFromJson(data io.Reader) *InitialLoad { 27 var o *InitialLoad 28 json.NewDecoder(data).Decode(&o) 29 return o 30 }