Skip to content

Commit

Permalink
Refine docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pellared committed Jan 3, 2024
1 parent b320802 commit e861833
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions baggage/baggage.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ func NewKeyProperty(key string) (Property, error) {

// NewKeyValueProperty returns a new Property for key with value.
//
// If key or value are invalid, an error will be returned.
// The passed key must be compliant with W3C Baggage specification.
// The passed value must be precent-encoded as defined in W3C Baggage specification.
//
// Deprecated: Use NewKeyValuePropertyRaw instead
// that does not require precent-encoding of the value.
Expand All @@ -83,7 +84,7 @@ func NewKeyValueProperty(key, value string) (Property, error) {

// NewKeyValuePropertyRaw returns a new Property for key with value.
//
// If key or value are invalid, an error will be returned.
// The passed key must be compliant with W3C Baggage specification.
func NewKeyValuePropertyRaw(key, value string) (Property, error) {
if !validateKey(key) {
return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidKey, key)
Expand Down Expand Up @@ -231,9 +232,10 @@ type Member struct {
hasData bool
}

// NewMemberRaw returns a new Member from the passed arguments. An error
// is returned if the created Member would be invalid according to the W3C
// Baggage specification.
// NewMemberRaw returns a new Member from the passed arguments.
//
// The passed key must be compliant with W3C Baggage specification.
// The passed value must be precent-encoded as defined in W3C Baggage specification.
//
// Deprecated: Use NewMemberRaw instead
// that does not require precent-encoding of the value.
Expand All @@ -248,9 +250,9 @@ func NewMember(key, value string, props ...Property) (Member, error) {
return NewMemberRaw(key, decodedValue, props...)
}

// NewMemberRaw returns a new Member from the passed arguments. An error
// is returned if the created Member would be invalid according to the W3C
// Baggage specification.
// NewMemberRaw returns a new Member from the passed arguments.
//
// The passed key must be compliant with W3C Baggage specification.
func NewMemberRaw(key, value string, props ...Property) (Member, error) {
m := Member{
key: key,
Expand Down

0 comments on commit e861833

Please sign in to comment.