Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Logger = slog.Default()
Functions ¶
func FuncName ¶
func FuncName() string
FuncName returns the name of the function that calls this function. This is useful when you want to define a constructor for a custom node without having to explicitly set its name. Example:
func SomeNode( args ) core.Node[Blackboard]{ name := util.FuncName() // will be "SomeNode" base := core.NewT(name) // T is Composite, Decorator or Leaf return &someNode{T: base} }
Types ¶
type ErrorBuilder ¶
type ErrorBuilder struct {
// contains filtered or unexported fields
}
ErrorBuilder wraps github.com/pkg/errors and lets the user build an error through successive writes, each one wrapping the builder's error written error message.
func (*ErrorBuilder) Error ¶
func (b *ErrorBuilder) Error() error
Error return the error builder's internal error.
func (*ErrorBuilder) SetMessage ¶
func (b *ErrorBuilder) SetMessage(format string, args ...any)
SetMessage sets a string that will be prepended to all successive calls to Write.
func (*ErrorBuilder) String ¶
func (b *ErrorBuilder) String() string
String returns the error builder's internal error string.
func (*ErrorBuilder) UnsetMessage ¶
func (b *ErrorBuilder) UnsetMessage()
UnsetMessage resets the prepended string.
func (*ErrorBuilder) Write ¶
func (b *ErrorBuilder) Write(format string, args ...any)
Write wraps the error builder's error with the arguments.
Click to show internal directories.
Click to hide internal directories.