github.com/adacta-ru/mattermost-server/v6@v6.0.0/model/initial_load.go (about)

     1  // Copyright (c) 2015-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 (il *InitialLoad) ToJson() string {
    22  	b, _ := json.Marshal(il)
    23  	return string(b)
    24  }
    25  
    26  func InitialLoadFromJson(data io.Reader) *InitialLoad {
    27  	var il *InitialLoad
    28  	json.NewDecoder(data).Decode(&il)
    29  	return il
    30  }