contextmain

package
v1.0.247 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2025 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CancelContext func()

CancelContext - функция отмены глобального контекста

Ctx хранит глобальный контекст программы не использовать * - чтоб можно было засунуть ссылку на чужой контекст

View Source
var MutexContextMain sync.RWMutex

MutexContextMain - гарантирует единственное создание контеста

Functions

func GetContext

func GetContext() context.Context

GetContext - возвращает глобальный контекст приложения

func GetNewContext

func GetNewContext() context.Context

GetNewContext - создаёт и возвращает новый контекст приложения

func SetCancelContext added in v1.0.135

func SetCancelContext(cancelContext func())

SetCancelContext - устанавливает функцию глобального отмены контекста, с учётом Mutex

func SetContext added in v1.0.135

func SetContext(ctx *context.Context)

SetContext - устанавливает глобальный контекст, с учётом Mutex

Types

This section is empty.

Jump to

Keyboard shortcuts

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