ftp_context

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: GPL-3.0 Imports: 8 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context = *ContextStruct

type ContextStruct

type ContextStruct struct {
	base.MutexedMap[any]
	// contains filtered or unexported fields
}

func CreateNewContext

func CreateNewContext() *ContextStruct

func CreateNewContextWithDeadline

func CreateNewContextWithDeadline(t time.Duration) (ctx *ContextStruct)

func CreateNewContextWithParent

func CreateNewContextWithParent(pctx *ContextStruct) (ctx *ContextStruct)

func (*ContextStruct) Add

func (ctx *ContextStruct) Add() Context

adds new goroutine to waitgroup

func (*ContextStruct) Cancel

func (ctx *ContextStruct) Cancel()

func (*ContextStruct) CancelDeadline

func (ctx *ContextStruct) CancelDeadline() (ok bool)

func (*ContextStruct) Created

func (ctx *ContextStruct) Created() time.Time

func (*ContextStruct) Deadline

func (ctx *ContextStruct) Deadline() (t time.Time, ok bool)

func (*ContextStruct) Done

func (ctx *ContextStruct) Done() <-chan struct{}

func (*ContextStruct) Err

func (ctx *ContextStruct) Err() error

func (*ContextStruct) Finished

func (ctx *ContextStruct) Finished()

marks goroutine as finished

func (*ContextStruct) Get

func (ctx *ContextStruct) Get(key string) (it any, ok bool)

func (*ContextStruct) NewChild

func (ctx *ContextStruct) NewChild() Context

func (*ContextStruct) SetDeadline

func (ctx *ContextStruct) SetDeadline(t time.Duration) (deadline time.Time)

func (*ContextStruct) SetParent

func (ctx *ContextStruct) SetParent(key string, val any) error

Sets current context and parent context

func (*ContextStruct) Value

func (ctx *ContextStruct) Value(key any) any

func (*ContextStruct) Wait

func (ctx *ContextStruct) Wait()

does not unblock on cancel

type LogErr

type LogErr = *LogItem

type LogItem

type LogItem struct {
	Location  string         `json:"location"`
	Time      time.Time      `json:"time"`
	After     string         `json:"after"`
	Body      map[string]any `json:"body"`
	Message   string         `json:"message"`
	Err       bool           `json:"is_error"`
	CallStack []error        `json:"call_stack"`
}

func NewLogItem

func NewLogItem(loc string, err bool) (lt *LogItem)

func (*LogItem) AppendParentError

func (li *LogItem) AppendParentError(err ...error) *LogItem

func (*LogItem) Error

func (li *LogItem) Error() string

func (*LogItem) Get

func (li *LogItem) Get(key string) (it any, ok bool)

func (*LogItem) Set

func (li *LogItem) Set(key string, value any) *LogItem

func (*LogItem) SetAfter

func (li *LogItem) SetAfter(after string) *LogItem

func (*LogItem) SetAfterf added in v0.4.0

func (li *LogItem) SetAfterf(after string, v ...any) *LogItem

func (*LogItem) SetMessage

func (lt *LogItem) SetMessage(v ...any) *LogItem

func (*LogItem) SetMessagef

func (lt *LogItem) SetMessagef(str string, v ...any) *LogItem

func (*LogItem) Setf

func (li *LogItem) Setf(key string, str string, value ...any) *LogItem

Jump to

Keyboard shortcuts

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