[#121] client: Make client parameter fields public #127
No reviewers
Labels
No labels
P0
P1
P2
P3
good first issue
pool
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
6 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-sdk-go#127
Loading…
Reference in a new issue
No description provided.
Delete branch "aarifullin/frostfs-sdk-go:feature/121-prm_public_fields"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Signed-off-by: Airat Arifullin a.arifullin@yadro.com
4c397c407f
to3e012baa61
@ -36,0 +33,4 @@
// Session is optional, if it is set the following requirements apply:
// - session operation MUST be session.VerbContainerPut (ForVerb)
// - token MUST be signed using private key of the owner of the container to be saved
Session *session.Container
I used pointer type for both
Container
andSession
to avoidcnrSet
,sessionSet
flags because this may cause errors@ -46,3 +39,1 @@
func (x *PrmContainerPut) WithinSession(s session.Container) {
x.session = s
x.sessionSet = true
func AsPointer[T container.Container | session.Container](t T) *T {
I have introduced pointer types above.
It's more convinient to create
PrmContainerPut
like that:and so on. But probably this convertation is unnecessary and will be removed
This helper is pretty trivial, do we want to (1) have it and (2) have it public?
3e012baa61
tob619735b3f
@ -53,6 +53,13 @@ func (x *prmCommonMeta) WithXHeaders(hs ...string) {
x.xHeaders = hs
}
func NewXHeaders(hs ...string) []string {
Quite a strange function IMO: it returns an argument, and panics if it is "wrong" without any comment.
Can we instead return
error
from theContainerPut
if the length is invalid? (in a separate commit).Good point. I made it copy-pasted from previous implementation. Alright. I'll fix it
Removed this method at all. I've introduced new error type and put the check within
buildRequest
method - I think this is proper placeb619735b3f
to738ba6cc1e
738ba6cc1e
tob7bbaefe13
[#121] client: Make client parameter fields publicto WIP: [#121] client: Make client parameter fields publicWIP because waiting for some tests from @aarifullin
b7bbaefe13
tof58a8c04f7
WIP: [#121] client: Make client parameter fields publicto [#121] client: Make client parameter fields publicRebased on master
f58a8c04f7
to90ebfa228c
@ -1221,6 +1221,13 @@ func (x *WaitParams) setDefaults() {
x.pollInterval = 5 * time.Second
}
func DefaultWaitParams() *WaitParams {
Do we need this function to be exported?
Good point
@ -1401,3 +1408,3 @@
// PrmContainerPut groups parameters of PutContainer operation.
type PrmContainerPut struct {
prmClient sdkClient.PrmContainerPut
Prm sdkClient.PrmContainerPut
Maybe it's better to name it
ClientPrm
orClientParams
?Fixed
90ebfa228c
toc02f4c8dca
c02f4c8dca
to9529f67c17
@ -44,2 +44,4 @@
// - session operation MUST be session.VerbContainerPut (ForVerb)
// - token MUST be signed using private key of the owner of the container to be saved
//
// NOTE: method is deprecated. Use public field for initialization instead.
We already have somewhat common syntax:
// Deprecated: use XXX instead.
(see.pb.go
files for example). I am not sure this^ pattern will be picked bystaticcheck
.Good! Thank you
9529f67c17
to25e0842513