forked from JointCloud/pcm-coordinator
25 lines
455 B
Go
25 lines
455 B
Go
package svc
|
|
|
|
import (
|
|
"PCM/adaptor/PCM-FC/PCM-SCF/internal/config"
|
|
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common"
|
|
)
|
|
|
|
type ServiceContext struct {
|
|
Config config.Config
|
|
Credential *common.Credential
|
|
}
|
|
|
|
func NewServiceContext(c config.Config) *ServiceContext {
|
|
|
|
credential := common.NewCredential(
|
|
c.SecretConfig.SecretId,
|
|
c.SecretConfig.SecretKey,
|
|
)
|
|
|
|
return &ServiceContext{
|
|
Credential: credential,
|
|
Config: c,
|
|
}
|
|
}
|