triggerv1

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package triggerv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	TriggerService_Invoke_FullMethodName       = "/agentpaas.trigger.v1.TriggerService/Invoke"
	TriggerService_InvokeStream_FullMethodName = "/agentpaas.trigger.v1.TriggerService/InvokeStream"
	TriggerService_GetRun_FullMethodName       = "/agentpaas.trigger.v1.TriggerService/GetRun"
	TriggerService_CancelRun_FullMethodName    = "/agentpaas.trigger.v1.TriggerService/CancelRun"
	TriggerService_ListRuns_FullMethodName     = "/agentpaas.trigger.v1.TriggerService/ListRuns"
)

Variables

View Source
var (
	RunStatus_name = map[int32]string{
		0: "RUN_STATUS_UNSPECIFIED",
		1: "RUN_STATUS_PENDING",
		2: "RUN_STATUS_RUNNING",
		3: "RUN_STATUS_SUCCEEDED",
		4: "RUN_STATUS_FAILED",
		5: "RUN_STATUS_CANCELLED",
		6: "RUN_STATUS_BUDGET_EXCEEDED",
	}
	RunStatus_value = map[string]int32{
		"RUN_STATUS_UNSPECIFIED":     0,
		"RUN_STATUS_PENDING":         1,
		"RUN_STATUS_RUNNING":         2,
		"RUN_STATUS_SUCCEEDED":       3,
		"RUN_STATUS_FAILED":          4,
		"RUN_STATUS_CANCELLED":       5,
		"RUN_STATUS_BUDGET_EXCEEDED": 6,
	}
)

Enum value maps for RunStatus.

View Source
var File_trigger_v1_trigger_proto protoreflect.FileDescriptor
View Source
var TriggerService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "agentpaas.trigger.v1.TriggerService",
	HandlerType: (*TriggerServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Invoke",
			Handler:    _TriggerService_Invoke_Handler,
		},
		{
			MethodName: "GetRun",
			Handler:    _TriggerService_GetRun_Handler,
		},
		{
			MethodName: "CancelRun",
			Handler:    _TriggerService_CancelRun_Handler,
		},
		{
			MethodName: "ListRuns",
			Handler:    _TriggerService_ListRuns_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "InvokeStream",
			Handler:       _TriggerService_InvokeStream_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "trigger/v1/trigger.proto",
}

TriggerService_ServiceDesc is the grpc.ServiceDesc for TriggerService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterTriggerServiceHandler

func RegisterTriggerServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterTriggerServiceHandler registers the http handlers for service TriggerService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterTriggerServiceHandlerClient

func RegisterTriggerServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TriggerServiceClient) error

RegisterTriggerServiceHandlerClient registers the http handlers for service TriggerService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TriggerServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TriggerServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "TriggerServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares.

func RegisterTriggerServiceHandlerFromEndpoint

func RegisterTriggerServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterTriggerServiceHandlerFromEndpoint is same as RegisterTriggerServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterTriggerServiceHandlerServer

func RegisterTriggerServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TriggerServiceServer) error

RegisterTriggerServiceHandlerServer registers the http handlers for service TriggerService to "mux". UnaryRPC :call TriggerServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterTriggerServiceHandlerFromEndpoint instead. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.

func RegisterTriggerServiceServer

func RegisterTriggerServiceServer(s grpc.ServiceRegistrar, srv TriggerServiceServer)

Types

type BudgetSummary

type BudgetSummary struct {
	TokenCount  int64   `protobuf:"varint,1,opt,name=token_count,json=tokenCount,proto3" json:"token_count,omitempty"`
	CostUsd     float64 `protobuf:"fixed64,2,opt,name=cost_usd,json=costUsd,proto3" json:"cost_usd,omitempty"`
	WallClockMs int64   `protobuf:"varint,3,opt,name=wall_clock_ms,json=wallClockMs,proto3" json:"wall_clock_ms,omitempty"`
	Iterations  int64   `protobuf:"varint,4,opt,name=iterations,proto3" json:"iterations,omitempty"`
	// contains filtered or unexported fields
}

BudgetSummary captures financial and resource usage for a run.

func (*BudgetSummary) Descriptor deprecated

func (*BudgetSummary) Descriptor() ([]byte, []int)

Deprecated: Use BudgetSummary.ProtoReflect.Descriptor instead.

func (*BudgetSummary) GetCostUsd

func (x *BudgetSummary) GetCostUsd() float64

func (*BudgetSummary) GetIterations

func (x *BudgetSummary) GetIterations() int64

func (*BudgetSummary) GetTokenCount

func (x *BudgetSummary) GetTokenCount() int64

func (*BudgetSummary) GetWallClockMs

func (x *BudgetSummary) GetWallClockMs() int64

func (*BudgetSummary) ProtoMessage

func (*BudgetSummary) ProtoMessage()

func (*BudgetSummary) ProtoReflect

func (x *BudgetSummary) ProtoReflect() protoreflect.Message

func (*BudgetSummary) Reset

func (x *BudgetSummary) Reset()

func (*BudgetSummary) String

func (x *BudgetSummary) String() string

type CancelRunRequest

type CancelRunRequest struct {
	RunId  string `protobuf:"bytes,1,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"`
	Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"`
	// contains filtered or unexported fields
}

func (*CancelRunRequest) Descriptor deprecated

func (*CancelRunRequest) Descriptor() ([]byte, []int)

Deprecated: Use CancelRunRequest.ProtoReflect.Descriptor instead.

func (*CancelRunRequest) GetReason

func (x *CancelRunRequest) GetReason() string

func (*CancelRunRequest) GetRunId

func (x *CancelRunRequest) GetRunId() string

func (*CancelRunRequest) ProtoMessage

func (*CancelRunRequest) ProtoMessage()

func (*CancelRunRequest) ProtoReflect

func (x *CancelRunRequest) ProtoReflect() protoreflect.Message

func (*CancelRunRequest) Reset

func (x *CancelRunRequest) Reset()

func (*CancelRunRequest) String

func (x *CancelRunRequest) String() string

type GetRunRequest

type GetRunRequest struct {
	RunId string `protobuf:"bytes,1,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"`
	// contains filtered or unexported fields
}

func (*GetRunRequest) Descriptor deprecated

func (*GetRunRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetRunRequest.ProtoReflect.Descriptor instead.

func (*GetRunRequest) GetRunId

func (x *GetRunRequest) GetRunId() string

func (*GetRunRequest) ProtoMessage

func (*GetRunRequest) ProtoMessage()

func (*GetRunRequest) ProtoReflect

func (x *GetRunRequest) ProtoReflect() protoreflect.Message

func (*GetRunRequest) Reset

func (x *GetRunRequest) Reset()

func (*GetRunRequest) String

func (x *GetRunRequest) String() string

type InvokeRequest

type InvokeRequest struct {
	AgentName    string `protobuf:"bytes,1,opt,name=agent_name,json=agentName,proto3" json:"agent_name,omitempty"`
	AgentVersion string `protobuf:"bytes,2,opt,name=agent_version,json=agentVersion,proto3" json:"agent_version,omitempty"`
	Payload      []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"`
	ContentType  string `protobuf:"bytes,4,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"`
	// idempotency_key ensures exactly-once semantics when combined with payload
	// hash. See file-level idempotency documentation for details.
	IdempotencyKey string            `protobuf:"bytes,5,opt,name=idempotency_key,json=idempotencyKey,proto3" json:"idempotency_key,omitempty"`
	Metadata       map[string]string `` /* 143-byte string literal not displayed */
	// contains filtered or unexported fields
}

InvokeRequest triggers an agent run.

Idempotency: see file-level comment above.

func (*InvokeRequest) Descriptor deprecated

func (*InvokeRequest) Descriptor() ([]byte, []int)

Deprecated: Use InvokeRequest.ProtoReflect.Descriptor instead.

func (*InvokeRequest) GetAgentName

func (x *InvokeRequest) GetAgentName() string

func (*InvokeRequest) GetAgentVersion

func (x *InvokeRequest) GetAgentVersion() string

func (*InvokeRequest) GetContentType

func (x *InvokeRequest) GetContentType() string

func (*InvokeRequest) GetIdempotencyKey

func (x *InvokeRequest) GetIdempotencyKey() string

func (*InvokeRequest) GetMetadata

func (x *InvokeRequest) GetMetadata() map[string]string

func (*InvokeRequest) GetPayload

func (x *InvokeRequest) GetPayload() []byte

func (*InvokeRequest) ProtoMessage

func (*InvokeRequest) ProtoMessage()

func (*InvokeRequest) ProtoReflect

func (x *InvokeRequest) ProtoReflect() protoreflect.Message

func (*InvokeRequest) Reset

func (x *InvokeRequest) Reset()

func (*InvokeRequest) String

func (x *InvokeRequest) String() string

type InvokeResponse

type InvokeResponse struct {
	Run *Run `protobuf:"bytes,1,opt,name=run,proto3" json:"run,omitempty"`
	// contains filtered or unexported fields
}

func (*InvokeResponse) Descriptor deprecated

func (*InvokeResponse) Descriptor() ([]byte, []int)

Deprecated: Use InvokeResponse.ProtoReflect.Descriptor instead.

func (*InvokeResponse) GetRun

func (x *InvokeResponse) GetRun() *Run

func (*InvokeResponse) ProtoMessage

func (*InvokeResponse) ProtoMessage()

func (*InvokeResponse) ProtoReflect

func (x *InvokeResponse) ProtoReflect() protoreflect.Message

func (*InvokeResponse) Reset

func (x *InvokeResponse) Reset()

func (*InvokeResponse) String

func (x *InvokeResponse) String() string

type ListRunsRequest

type ListRunsRequest struct {

	// Optional: filter by agent name.
	AgentName string `protobuf:"bytes,1,opt,name=agent_name,json=agentName,proto3" json:"agent_name,omitempty"`
	// Optional: filter by run status.
	Status RunStatus `protobuf:"varint,2,opt,name=status,proto3,enum=agentpaas.trigger.v1.RunStatus" json:"status,omitempty"`
	// Maximum number of runs to return. Server may cap this value.
	PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	// Token from a previous ListRunsResponse to request the next page.
	PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
	// contains filtered or unexported fields
}

func (*ListRunsRequest) Descriptor deprecated

func (*ListRunsRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListRunsRequest.ProtoReflect.Descriptor instead.

func (*ListRunsRequest) GetAgentName

func (x *ListRunsRequest) GetAgentName() string

func (*ListRunsRequest) GetPageSize

func (x *ListRunsRequest) GetPageSize() int32

func (*ListRunsRequest) GetPageToken

func (x *ListRunsRequest) GetPageToken() string

func (*ListRunsRequest) GetStatus

func (x *ListRunsRequest) GetStatus() RunStatus

func (*ListRunsRequest) ProtoMessage

func (*ListRunsRequest) ProtoMessage()

func (*ListRunsRequest) ProtoReflect

func (x *ListRunsRequest) ProtoReflect() protoreflect.Message

func (*ListRunsRequest) Reset

func (x *ListRunsRequest) Reset()

func (*ListRunsRequest) String

func (x *ListRunsRequest) String() string

type ListRunsResponse

type ListRunsResponse struct {
	Runs          []*Run `protobuf:"bytes,1,rep,name=runs,proto3" json:"runs,omitempty"`
	NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
	// contains filtered or unexported fields
}

func (*ListRunsResponse) Descriptor deprecated

func (*ListRunsResponse) Descriptor() ([]byte, []int)

Deprecated: Use ListRunsResponse.ProtoReflect.Descriptor instead.

func (*ListRunsResponse) GetNextPageToken

func (x *ListRunsResponse) GetNextPageToken() string

func (*ListRunsResponse) GetRuns

func (x *ListRunsResponse) GetRuns() []*Run

func (*ListRunsResponse) ProtoMessage

func (*ListRunsResponse) ProtoMessage()

func (*ListRunsResponse) ProtoReflect

func (x *ListRunsResponse) ProtoReflect() protoreflect.Message

func (*ListRunsResponse) Reset

func (x *ListRunsResponse) Reset()

func (*ListRunsResponse) String

func (x *ListRunsResponse) String() string

type Run

type Run struct {
	RunId         string                 `protobuf:"bytes,1,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"`
	AgentName     string                 `protobuf:"bytes,2,opt,name=agent_name,json=agentName,proto3" json:"agent_name,omitempty"`
	AgentVersion  string                 `protobuf:"bytes,3,opt,name=agent_version,json=agentVersion,proto3" json:"agent_version,omitempty"`
	Status        RunStatus              `protobuf:"varint,4,opt,name=status,proto3,enum=agentpaas.trigger.v1.RunStatus" json:"status,omitempty"`
	CreatedAt     *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	StartedAt     *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=started_at,json=startedAt,proto3" json:"started_at,omitempty"`
	FinishedAt    *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=finished_at,json=finishedAt,proto3" json:"finished_at,omitempty"`
	Error         string                 `protobuf:"bytes,8,opt,name=error,proto3" json:"error,omitempty"`
	BudgetSummary *BudgetSummary         `protobuf:"bytes,9,opt,name=budget_summary,json=budgetSummary,proto3" json:"budget_summary,omitempty"`
	PolicyDigest  string                 `protobuf:"bytes,10,opt,name=policy_digest,json=policyDigest,proto3" json:"policy_digest,omitempty"`
	ImageDigest   string                 `protobuf:"bytes,11,opt,name=image_digest,json=imageDigest,proto3" json:"image_digest,omitempty"`
	// contains filtered or unexported fields
}

Run represents a single agent execution.

func (*Run) Descriptor deprecated

func (*Run) Descriptor() ([]byte, []int)

Deprecated: Use Run.ProtoReflect.Descriptor instead.

func (*Run) GetAgentName

func (x *Run) GetAgentName() string

func (*Run) GetAgentVersion

func (x *Run) GetAgentVersion() string

func (*Run) GetBudgetSummary

func (x *Run) GetBudgetSummary() *BudgetSummary

func (*Run) GetCreatedAt

func (x *Run) GetCreatedAt() *timestamppb.Timestamp

func (*Run) GetError

func (x *Run) GetError() string

func (*Run) GetFinishedAt

func (x *Run) GetFinishedAt() *timestamppb.Timestamp

func (*Run) GetImageDigest

func (x *Run) GetImageDigest() string

func (*Run) GetPolicyDigest

func (x *Run) GetPolicyDigest() string

func (*Run) GetRunId

func (x *Run) GetRunId() string

func (*Run) GetStartedAt

func (x *Run) GetStartedAt() *timestamppb.Timestamp

func (*Run) GetStatus

func (x *Run) GetStatus() RunStatus

func (*Run) ProtoMessage

func (*Run) ProtoMessage()

func (*Run) ProtoReflect

func (x *Run) ProtoReflect() protoreflect.Message

func (*Run) Reset

func (x *Run) Reset()

func (*Run) String

func (x *Run) String() string

type RunStatus

type RunStatus int32

RunStatus represents the lifecycle state of an agent run.

const (
	RunStatus_RUN_STATUS_UNSPECIFIED     RunStatus = 0
	RunStatus_RUN_STATUS_PENDING         RunStatus = 1
	RunStatus_RUN_STATUS_RUNNING         RunStatus = 2
	RunStatus_RUN_STATUS_SUCCEEDED       RunStatus = 3
	RunStatus_RUN_STATUS_FAILED          RunStatus = 4
	RunStatus_RUN_STATUS_CANCELLED       RunStatus = 5
	RunStatus_RUN_STATUS_BUDGET_EXCEEDED RunStatus = 6
)

func (RunStatus) Descriptor

func (RunStatus) Descriptor() protoreflect.EnumDescriptor

func (RunStatus) Enum

func (x RunStatus) Enum() *RunStatus

func (RunStatus) EnumDescriptor deprecated

func (RunStatus) EnumDescriptor() ([]byte, []int)

Deprecated: Use RunStatus.Descriptor instead.

func (RunStatus) Number

func (x RunStatus) Number() protoreflect.EnumNumber

func (RunStatus) String

func (x RunStatus) String() string

func (RunStatus) Type

type TriggerServiceClient

type TriggerServiceClient interface {
	// Invoke triggers a single agent run and returns the Run immediately.
	Invoke(ctx context.Context, in *InvokeRequest, opts ...grpc.CallOption) (*InvokeResponse, error)
	// InvokeStream triggers an agent run and returns a stream of Run updates
	// via server-sent events (SSE).
	InvokeStream(ctx context.Context, in *InvokeRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[InvokeResponse], error)
	// GetRun retrieves a run by its ID.
	GetRun(ctx context.Context, in *GetRunRequest, opts ...grpc.CallOption) (*Run, error)
	// CancelRun cancels a pending or running run.
	CancelRun(ctx context.Context, in *CancelRunRequest, opts ...grpc.CallOption) (*Run, error)
	// ListRuns lists runs with optional filters and pagination.
	ListRuns(ctx context.Context, in *ListRunsRequest, opts ...grpc.CallOption) (*ListRunsResponse, error)
}

TriggerServiceClient is the client API for TriggerService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

TriggerService manages agent invocation and run lifecycle.

type TriggerServiceServer

type TriggerServiceServer interface {
	// Invoke triggers a single agent run and returns the Run immediately.
	Invoke(context.Context, *InvokeRequest) (*InvokeResponse, error)
	// InvokeStream triggers an agent run and returns a stream of Run updates
	// via server-sent events (SSE).
	InvokeStream(*InvokeRequest, grpc.ServerStreamingServer[InvokeResponse]) error
	// GetRun retrieves a run by its ID.
	GetRun(context.Context, *GetRunRequest) (*Run, error)
	// CancelRun cancels a pending or running run.
	CancelRun(context.Context, *CancelRunRequest) (*Run, error)
	// ListRuns lists runs with optional filters and pagination.
	ListRuns(context.Context, *ListRunsRequest) (*ListRunsResponse, error)
	// contains filtered or unexported methods
}

TriggerServiceServer is the server API for TriggerService service. All implementations must embed UnimplementedTriggerServiceServer for forward compatibility.

TriggerService manages agent invocation and run lifecycle.

type TriggerService_InvokeStreamClient

type TriggerService_InvokeStreamClient = grpc.ServerStreamingClient[InvokeResponse]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type TriggerService_InvokeStreamServer

type TriggerService_InvokeStreamServer = grpc.ServerStreamingServer[InvokeResponse]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type UnimplementedTriggerServiceServer

type UnimplementedTriggerServiceServer struct{}

UnimplementedTriggerServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedTriggerServiceServer) CancelRun

func (UnimplementedTriggerServiceServer) GetRun

func (UnimplementedTriggerServiceServer) Invoke

func (UnimplementedTriggerServiceServer) InvokeStream

func (UnimplementedTriggerServiceServer) ListRuns

type UnsafeTriggerServiceServer

type UnsafeTriggerServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeTriggerServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TriggerServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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