drpcmetadata

package
v0.0.30 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2022 License: MIT Imports: 4 Imported by: 10

README

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, metadata map[string]string) context.Context

AddPairs attaches metadata onto a context and return the context.

func Decode
func Decode(buf []byte) (map[string]string, error)

Decode translate byte form of metadata into key/value metadata.

func Encode
func Encode(buf []byte, metadata map[string]string) ([]byte, error)

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

func Get
func Get(ctx context.Context) (map[string]string, bool)

Get returns all key/value pairs on the given context.

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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, metadata map[string]string) context.Context

AddPairs attaches metadata onto a context and return the context.

func Decode

func Decode(buf []byte) (map[string]string, error)

Decode translate byte form of metadata into key/value metadata.

func Encode

func Encode(buf []byte, metadata map[string]string) ([]byte, error)

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

func Get

func Get(ctx context.Context) (map[string]string, bool)

Get returns all key/value pairs on the given context.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL