dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts@v1.0.2/dtos/common/config.go (about)

     1  //
     2  // Copyright (C) 2020-2021 IOTech Ltd
     3  // Copyright (C) 2020 Intel Corporation
     4  //
     5  // SPDX-License-Identifier: Apache-2.0
     6  
     7  package common
     8  
     9  // ConfigResponse defines the configuration for the targeted service.
    10  type ConfigResponse struct {
    11  	Versionable `json:",inline"`
    12  	Config      interface{} `json:"config"`
    13  	ServiceName string      `json:"serviceName"`
    14  }
    15  
    16  // NewConfigResponse creates new ConfigResponse with all fields set appropriately
    17  func NewConfigResponse(serviceConfig interface{}, serviceName string) ConfigResponse {
    18  	return ConfigResponse{
    19  		Versionable: NewVersionable(),
    20  		Config:      serviceConfig,
    21  		ServiceName: serviceName,
    22  	}
    23  }