Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

service: bucket #3

Merged
merged 1 commit into from
Mar 23, 2022
Merged

Conversation

yamamoto-febc
Copy link
Member

バケットに対するCreate / Read / Delete / List操作を提供する。

    func (s *Service) Create(req *CreateRequest) (*Bucket, error)
    func (s *Service) CreateWithContext(ctx context.Context, req *CreateRequest) (*Bucket, error)

    func (s *Service) Delete(req *DeleteRequest) error
    func (s *Service) DeleteWithContext(ctx context.Context, req *DeleteRequest) error

    func (s *Service) Find(req *FindRequest) ([]*Bucket, error)
    func (s *Service) FindWithContext(ctx context.Context, req *FindRequest) ([]*Bucket, error)

    func (s *Service) Read(req *ReadRequest) (*Bucket, error)
    func (s *Service) ReadWithContext(ctx context.Context, req *ReadRequest) (*Bucket, error)

💡 ReadとListについてはさくらのオブジェクトストレージAPIではなくs3互換API経由での操作となるため、
アクセスキー/シークレットをパラメータとして渡す必要がある。

req := &FindRequest{
	AccessKey: key,
	SecretKey: secret,
	SiteId:    siteId,
}
buckets, err := svc.Find(req)

@yamamoto-febc yamamoto-febc merged commit 7dd5ba4 into sacloud:main Mar 23, 2022
@yamamoto-febc yamamoto-febc deleted the service/buckets branch March 23, 2022 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant