23 lines
400 B
Go
23 lines
400 B
Go
package svc
|
|
|
|
import (
|
|
"context"
|
|
"juwan-backend/app/objectstory/rpc/internal/config"
|
|
|
|
"github.com/aws/aws-sdk-go-v2/service/s3"
|
|
)
|
|
|
|
type ServiceContext struct {
|
|
Config config.Config
|
|
S3 *s3.Client
|
|
}
|
|
|
|
func NewServiceContext(c config.Config) *ServiceContext {
|
|
s3obj := NewObjectStorage(c.S3Conf)
|
|
|
|
return &ServiceContext{
|
|
Config: c,
|
|
S3: s3obj.MustNews3Client(context.Background()),
|
|
}
|
|
}
|