state

package
v0.0.0-...-6e5b399 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package state implements the agent state. This is a separate package to enforce access to a limited public API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

type State struct {
	*botman.Botman
	// contains filtered or unexported fields
}

State contains the agent state for the lifetime of one drone UUID assignment.

func New

func New(uuid string, h botman.WorldHook) *State

New creates a new instance of agent state.

func (*State) SetExpiration

func (s *State) SetExpiration(t time.Time)

SetExpiration sets a new expiration time. Note that if the expiration already fired, this does nothing.

func (*State) UUID

func (s *State) UUID() string

UUID returns the drone UUID.

func (*State) WithExpire

func (s *State) WithExpire(ctx context.Context, t time.Time) context.Context

WithExpire sets up the delayable expiration context.

Jump to

Keyboard shortcuts

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