Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
README.md | H A D | 14-Jul-2021 | 940 | 45 | 31 | |
doc.go | H A D | 14-Jul-2021 | 189 | 6 | 1 | |
metadata.go | H A D | 14-Jul-2021 | 1.6 KiB | 69 | 50 | |
metadata_test.go | H A D | 14-Jul-2021 | 1.5 KiB | 80 | 64 | |
serialize.go | H A D | 14-Jul-2021 | 1.8 KiB | 85 | 64 | |
serialize_test.go | H A D | 14-Jul-2021 | 1.2 KiB | 49 | 39 |
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