github.com/vnforks/kid/v5@v5.22.1-0.20200408055009-b89d99c65676/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  	// BranchMembers []*BranchMember     `json:"branch_members"`
    14  	// Branches       []*Branch           `json:"branches"`
    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  }