Skip to content

Commit

Permalink
chore: tweak resource payload
Browse files Browse the repository at this point in the history
  • Loading branch information
boojack committed May 17, 2024
1 parent 0c251f9 commit b0aad6f
Show file tree
Hide file tree
Showing 11 changed files with 237 additions and 204 deletions.
30 changes: 15 additions & 15 deletions docs/apidocs.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1850,6 +1850,20 @@ definitions:
expiresAt:
type: string
format: date-time
WorkspaceStorageSettingS3Config:
type: object
properties:
accessKeyId:
type: string
accessKeySecret:
type: string
endpoint:
type: string
region:
type: string
bucket:
type: string
title: 'Reference: https://developers.cloudflare.com/r2/examples/aws/aws-sdk-go/'
apiHttpBody:
type: object
properties:
Expand Down Expand Up @@ -2086,22 +2100,8 @@ definitions:
format: int64
description: The max upload size in megabytes.
s3Config:
$ref: '#/definitions/apiv1WorkspaceStorageSettingS3Config'
$ref: '#/definitions/WorkspaceStorageSettingS3Config'
description: The S3 config.
apiv1WorkspaceStorageSettingS3Config:
type: object
properties:
accessKeyId:
type: string
accessKeySecret:
type: string
endpoint:
type: string
region:
type: string
bucket:
type: string
title: 'Reference: https://developers.cloudflare.com/r2/examples/aws/aws-sdk-go/'
apiv1WorkspaceStorageSettingStorageType:
type: string
enum:
Expand Down
2 changes: 1 addition & 1 deletion plugin/storage/s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type Client struct {
Bucket *string
}

func NewClient(ctx context.Context, s3Config *storepb.WorkspaceStorageSetting_S3Config) (*Client, error) {
func NewClient(ctx context.Context, s3Config *storepb.StorageS3Config) (*Client, error) {
resolver := aws.EndpointResolverWithOptionsFunc(func(service, region string, options ...any) (aws.Endpoint, error) {
return aws.Endpoint{
URL: s3Config.Endpoint,
Expand Down
94 changes: 55 additions & 39 deletions proto/gen/store/resource.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b0aad6f

Please sign in to comment.