package
0.0.0-20231126024412-02539191b02e
Repository: https://github.com/mjpitz/myago.git
Documentation: pkg.go.dev

# README

clocks

Package clocks provides code for setting up and managing clocks on contexts.

import go.pitz.tech/lib/clocks

Usage

func Extract

func Extract(ctx context.Context) clockwork.Clock

Extract pulls the clock from the provided context. If no clock is found, then the defaultClock is returned.

func Setup

func Setup(ctx context.Context) context.Context

Setup sets the defaultClock on the provided context. This can always be overridden later.

func ToContext

func ToContext(ctx context.Context, clock clockwork.Clock) context.Context

ToContext sets the clock on the provided context.

# Functions

Extract pulls the clock from the provided context.
Setup sets the defaultClock on the provided context.
ToContext sets the clock on the provided context.