package service import "time" type Config struct { CenterServer string `json:"centerServer,omitempty"` HostName string `json:"hostName,omitempty"` InstanceId string `json:"instanceId,omitempty"` ReportInterval time.Duration `json:"reportInterval,omitempty"` } type Service struct { config Config } func NewService(config Config) *Service { service := Service{ config: config, } return &service }