github.com/demisto/mattermost-server@v4.9.0-rc3+incompatible/model/system.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  	"math/big"
    10  )
    11  
    12  const (
    13  	SYSTEM_DIAGNOSTIC_ID          = "DiagnosticId"
    14  	SYSTEM_RAN_UNIT_TESTS         = "RanUnitTests"
    15  	SYSTEM_LAST_SECURITY_TIME     = "LastSecurityTime"
    16  	SYSTEM_ACTIVE_LICENSE_ID      = "ActiveLicenseId"
    17  	SYSTEM_LAST_COMPLIANCE_TIME   = "LastComplianceTime"
    18  	SYSTEM_ASYMMETRIC_SIGNING_KEY = "AsymmetricSigningKey"
    19  )
    20  
    21  type System struct {
    22  	Name  string `json:"name"`
    23  	Value string `json:"value"`
    24  }
    25  
    26  func (o *System) ToJson() string {
    27  	b, _ := json.Marshal(o)
    28  	return string(b)
    29  }
    30  
    31  func SystemFromJson(data io.Reader) *System {
    32  	var o *System
    33  	json.NewDecoder(data).Decode(&o)
    34  	return o
    35  }
    36  
    37  type SystemAsymmetricSigningKey struct {
    38  	ECDSAKey *SystemECDSAKey `json:"ecdsa_key,omitempty"`
    39  }
    40  
    41  type SystemECDSAKey struct {
    42  	Curve string   `json:"curve"`
    43  	X     *big.Int `json:"x"`
    44  	Y     *big.Int `json:"y"`
    45  	D     *big.Int `json:"d,omitempty"`
    46  }