metax

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 4 Imported by: 2

README

Metax

GoDoc Widget Build Status codecov Go Report Card

Storing meta in context

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWith

func ContextWith(ctx context.Context, key string, values ...string) context.Context

func ContextWithMeta

func ContextWithMeta(ctx context.Context, meta Meta) context.Context

Types

type Ctx

type Ctx struct {
	// contains filtered or unexported fields
}

func CtxFromContext

func CtxFromContext(ctx context.Context) Ctx

func (Ctx) Context

func (c Ctx) Context() context.Context

func (Ctx) WithContext

func (c Ctx) WithContext(ctx context.Context) Ctx

type Meta

type Meta map[string][]string

func MetaFromContext

func MetaFromContext(ctx context.Context) Meta

func ParseMeta

func ParseMeta(query string) Meta

func (Meta) Add

func (m Meta) Add(key string, values ...string)

func (Meta) Clone

func (m Meta) Clone() Meta

func (Meta) Get

func (m Meta) Get(key string) string

func (Meta) Merge

func (m Meta) Merge(metas ...Meta) Meta

func (Meta) String

func (m Meta) String() string

func (Meta) With

func (m Meta) With(key string, values ...string) Meta

Jump to

Keyboard shortcuts

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