1234567891011121314151617181920212223 |
- package svc
- import (
- "app.yhyue.com/moapp/jyfs/rpc/internal/config"
- "github.com/aliyun/aliyun-oss-go-sdk/oss"
- "log"
- )
- type ServiceContext struct {
- Config config.Config
- OssClient *oss.Client
- }
- func NewServiceContext(c config.Config) *ServiceContext {
- client, err := oss.New(c.OssEndPoint, c.OssAccessKeyId, c.OssAccessKeySecret)
- if err != nil {
- log.Fatal(err)
- }
- return &ServiceContext{
- Config: c,
- OssClient: client,
- }
- }
|