rename Read / Write into Unmarshal / Marshal when needed

Read() / Write() are used to read / write from streams, while
Unmarshal() / Marshal() are used to decode / encode from / to bytes.
This commit is contained in:
aler9
2022-06-27 17:26:00 +02:00
parent e3c9f0c2e6
commit f3b0fc69b4
44 changed files with 569 additions and 559 deletions

View File

@@ -49,8 +49,8 @@ type Authenticate struct {
Algorithm *string
}
// Read decodes an Authenticate or a WWW-Authenticate header.
func (h *Authenticate) Read(v base.HeaderValue) error {
// Unmarshal decodes an Authenticate or a WWW-Authenticate header.
func (h *Authenticate) Unmarshal(v base.HeaderValue) error {
if len(v) == 0 {
return fmt.Errorf("value not provided")
}
@@ -116,8 +116,8 @@ func (h *Authenticate) Read(v base.HeaderValue) error {
return nil
}
// Write encodes an Authenticate or a WWW-Authenticate header.
func (h Authenticate) Write() base.HeaderValue {
// Marshal encodes an Authenticate or a WWW-Authenticate header.
func (h Authenticate) Marshal() base.HeaderValue {
ret := ""
switch h.Method {