event

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CustomEventURI      = "harness:custom-event"
	CustomEventMIMEType = "application/vnd.harness.custom-event+json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomEvent

type CustomEvent struct {
	Type         string `json:"type"`
	Continue     bool   `json:"continue,omitempty"`      // wether the agent should continue or stop processing
	DisplayOrder int    `json:"display_order,omitempty"` // default will be the order that the items are added
	Content      any    `json:"content,omitempty"`
}

CustomEvent represents a custom event sent back to a client as embedded resource

func NewCustomEvent

func NewCustomEvent(eventType string, content any, opts ...CustomEventOption) CustomEvent

NewCustomEvent creates a new custom event with provided type and content

func (CustomEvent) CreateCustomResource

func (e CustomEvent) CreateCustomResource() (*mcp.TextResourceContents, error)

CreateResource creates a resource from this event

func (CustomEvent) CreateEmbeddedResource

func (e CustomEvent) CreateEmbeddedResource() (mcp.Content, error)

CreateEmbeddedResource creates an embedded resource from this event

type CustomEventOption

type CustomEventOption func(*CustomEvent)

CustomEventOption configures a CustomEvent

func WithContinue

func WithContinue(continueFlag bool) CustomEventOption

WithContinue sets whether the event allows continuation

func WithDisplayOrder

func WithDisplayOrder(order int) CustomEventOption

WithDisplayOrder sets the display order for the event

Directories

Path Synopsis
Package types provides specific event type implementations
Package types provides specific event type implementations

Jump to

Keyboard shortcuts

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