• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

README.mdH A D14-Jul-2021940 4531

doc.goH A D14-Jul-2021189 61

metadata.goH A D14-Jul-20211.6 KiB6950

metadata_test.goH A D14-Jul-20211.5 KiB8064

serialize.goH A D14-Jul-20211.8 KiB8564

serialize_test.goH A D14-Jul-20211.2 KiB4939

README.md

1# package drpcmetadata
2
3`import "storj.io/drpc/drpcmetadata"`
4
5Package drpcmetadata define the structure of the metadata supported by drpc
6library.
7
8## Usage
9
10#### func  Add
11
12```go
13func Add(ctx context.Context, key, value string) context.Context
14```
15Add associates a key/value pair on the context.
16
17#### func  AddPairs
18
19```go
20func AddPairs(ctx context.Context, metadata map[string]string) context.Context
21```
22AddPairs attaches metadata onto a context and return the context.
23
24#### func  Decode
25
26```go
27func Decode(buf []byte) (map[string]string, error)
28```
29Decode translate byte form of metadata into key/value metadata.
30
31#### func  Encode
32
33```go
34func Encode(buf []byte, metadata map[string]string) ([]byte, error)
35```
36Encode generates byte form of the metadata and appends it onto the passed in
37buffer.
38
39#### func  Get
40
41```go
42func Get(ctx context.Context) (map[string]string, bool)
43```
44Get returns all key/value pairs on the given context.
45