metadata

package
v4.0.0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendCellsMetaFromContext

func AppendCellsMetaFromContext(ctx context.Context, req *http.Request)

AppendCellsMetaFromContext extract valid header names from context and push them to the request Headers

func CanonicalMeta

func CanonicalMeta(ctx context.Context, name string) (string, bool)

CanonicalMeta extract header name or its lowercase version

func MinioMetaFromContext

func MinioMetaFromContext(ctx context.Context) (md map[string]string, ok bool)

MinioMetaFromContext prepares metadata for minio client, merging context medata and eventually the Context User Key value (X-Pydio-User). Used to prepare metadata sent by Minio Clients

func NewBackgroundWithMetaCopy

func NewBackgroundWithMetaCopy(ctx context.Context) context.Context

func NewBackgroundWithUserKey

func NewBackgroundWithUserKey(userName string) context.Context

func NewContext

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

func WithAdditionalMetadata

func WithAdditionalMetadata(ctx context.Context, meta map[string]string) context.Context

WithAdditionalMetadata retrieves existing meta, adds new key/values to the map and produces a new context It enforces case-conflicts on all keys

func WithMetaCopy

func WithMetaCopy(ctx context.Context) context.Context

WithMetaCopy makes sure the metadata map will is replicated and unique to this context

func WithUserNameMetadata

func WithUserNameMetadata(ctx context.Context, userName string) context.Context

WithUserNameMetadata appends a user name to both the context metadata and as context key.

Types

type Metadata

type Metadata map[string]string

func FromContextCopy added in v4.0.1

func FromContextCopy(ctx context.Context) (Metadata, bool)

FromContextCopy returns as COPY of the internal metadata, that can be subsequently modified

func FromContextRead added in v4.0.1

func FromContextRead(ctx context.Context) (Metadata, bool)

FromContextRead returns internal metadata as is. Beware of not modifying it to avoid r/w concurrent access, in that case you must use FromContextCopy instead.

Jump to

Keyboard shortcuts

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