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
Click to show internal directories.
Click to hide internal directories.