rclone/vendor/storj.io/drpc/drpcmetadata
2020-05-12 15:56:50 +00:00
..
invoke Tardigrade Backend: Dependencies 2020-05-12 15:56:50 +00:00
doc.go Tardigrade Backend: Dependencies 2020-05-12 15:56:50 +00:00
metadata.go Tardigrade Backend: Dependencies 2020-05-12 15:56:50 +00:00
README.md Tardigrade Backend: Dependencies 2020-05-12 15:56:50 +00:00

package drpcmetadata

import "storj.io/drpc/drpcmetadata"

Package drpcmetadata define the structure of the metadata supported by drpc library.

Usage

func Add

func Add(ctx context.Context, key, value string) context.Context

Add associates a key/value pair on the context.

func AddPairs

func AddPairs(ctx context.Context, md map[string]string) context.Context

AddPairs attaches metadata onto a context and return the context.

func Decode

func Decode(data []byte) (*invoke.InvokeMetadata, error)

Decode translate byte form of metadata into metadata struct defined by protobuf.

func Encode

func Encode(buffer []byte) ([]byte, error)

Encode generates byte form of the metadata and appends it onto the passed in buffer.