options

package module
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: Apache-2.0 Imports: 2 Imported by: 5

README

GoDoc

options

import "github.com/go-coldbrew/options"

Index

func AddToOptions

func AddToOptions(ctx context.Context, key string, value interface{}) context.Context

AddToOptions adds options to context if no options found, create a new one and adds the provided options to it and returns the new context

type Options

Options are request options passed from ColdBrew to server

type Options struct {
    sync.Map
}
func FromContext
func FromContext(ctx context.Context) *Options

FromContext fetchs options from provided context if no options found, return nil

func (*Options) Add
func (o *Options) Add(key string, value interface{})

Add to Options can be used to add options to context

func (*Options) Del
func (o *Options) Del(key string)

Del an options can be used to delete options from context

func (*Options) Get
func (o *Options) Get(key string) (interface{}, bool)

Get an options can be used to get options from context

Generated by gomarkdoc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddToOptions

func AddToOptions(ctx context.Context, key string, value any) context.Context

AddToOptions adds options to context if no options found, create a new one and adds the provided options to it and returns the new context

Types

type Options

type Options struct {
	sync.Map
}

Options are request options passed from ColdBrew to server

func FromContext

func FromContext(ctx context.Context) *Options

FromContext fetchs options from provided context if no options found, return nil

func (*Options) Add

func (o *Options) Add(key string, value any)

Add to Options can be used to add options to context

func (*Options) Del

func (o *Options) Del(key string)

Del an options can be used to delete options from context

func (*Options) Get

func (o *Options) Get(key string) (any, bool)

Get an options can be used to get options from context

Jump to

Keyboard shortcuts

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