actions

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionsService_ApplyAction_FullMethodName = "/aks.flex.components.services.actions.ActionsService/ApplyAction"
)

Variables

View Source
var (
	Default = NewHub()

	// MustRegister registers a action server for a giving action message type.
	// It panics if the server instantiation fails.
	MustRegister = Default.MustRegister
)
View Source
var ActionsService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "aks.flex.components.services.actions.ActionsService",
	HandlerType: (*ActionsServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ApplyAction",
			Handler:    _ActionsService_ApplyAction_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "components/services/actions/actions.proto",
}

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

View Source
var File_components_services_actions_actions_proto protoreflect.FileDescriptor

Functions

func ApplyAction

func ApplyAction[M proto.Message](
	conn *grpc.ClientConn,
	ctx context.Context,
	m M,
	opts ...grpc.CallOption,
) (M, error)

ApplyAction invokes the ApplyAction method on a giving gRPC client

func RegisterActionsServiceServer

func RegisterActionsServiceServer(s grpc.ServiceRegistrar, srv ActionsServiceServer)

Types

type ActionsServiceClient

type ActionsServiceClient interface {
	ApplyAction(ctx context.Context, in *ApplyActionRequest, opts ...grpc.CallOption) (*ApplyActionResponse, error)
}

ActionsServiceClient is the client API for ActionsService 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.

type ActionsServiceServer

type ActionsServiceServer interface {
	ApplyAction(context.Context, *ApplyActionRequest) (*ApplyActionResponse, error)
	// contains filtered or unexported methods
}

ActionsServiceServer is the server API for ActionsService service. All implementations must embed UnimplementedActionsServiceServer for forward compatibility.

type ApplyActionRequest

type ApplyActionRequest struct {
	// contains filtered or unexported fields
}

func (*ApplyActionRequest) ClearItem

func (x *ApplyActionRequest) ClearItem()

func (*ApplyActionRequest) GetItem

func (x *ApplyActionRequest) GetItem() *anypb.Any

func (*ApplyActionRequest) HasItem

func (x *ApplyActionRequest) HasItem() bool

func (*ApplyActionRequest) ProtoMessage

func (*ApplyActionRequest) ProtoMessage()

func (*ApplyActionRequest) ProtoReflect

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

func (*ApplyActionRequest) Reset

func (x *ApplyActionRequest) Reset()

func (*ApplyActionRequest) SetItem

func (x *ApplyActionRequest) SetItem(v *anypb.Any)

func (*ApplyActionRequest) String

func (x *ApplyActionRequest) String() string

type ApplyActionRequest_builder

type ApplyActionRequest_builder struct {
	Item *anypb.Any
	// contains filtered or unexported fields
}

func (ApplyActionRequest_builder) Build

type ApplyActionResponse

type ApplyActionResponse struct {
	// contains filtered or unexported fields
}

func (*ApplyActionResponse) ClearItem

func (x *ApplyActionResponse) ClearItem()

func (*ApplyActionResponse) GetItem

func (x *ApplyActionResponse) GetItem() *anypb.Any

func (*ApplyActionResponse) HasItem

func (x *ApplyActionResponse) HasItem() bool

func (*ApplyActionResponse) ProtoMessage

func (*ApplyActionResponse) ProtoMessage()

func (*ApplyActionResponse) ProtoReflect

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

func (*ApplyActionResponse) Reset

func (x *ApplyActionResponse) Reset()

func (*ApplyActionResponse) SetItem

func (x *ApplyActionResponse) SetItem(v *anypb.Any)

func (*ApplyActionResponse) String

func (x *ApplyActionResponse) String() string

type ApplyActionResponse_builder

type ApplyActionResponse_builder struct {
	Item *anypb.Any
	// contains filtered or unexported fields
}

func (ApplyActionResponse_builder) Build

type Hub

type Hub struct {
	Servers map[string]Server

	UnimplementedActionsServiceServer
}

Hub is the central registry for all actions. It forwards the ApplyAction request to the corresponding server based on the action type.

func NewHub

func NewHub() *Hub

func (*Hub) ApplyAction

func (h *Hub) ApplyAction(
	ctx context.Context,
	req *ApplyActionRequest,
) (*ApplyActionResponse, error)

func (*Hub) MustRegister

func (h *Hub) MustRegister(newServer func() (Server, error), msg proto.Message)

type Server

type Server interface {
	ApplyAction(context.Context, *ApplyActionRequest) (*ApplyActionResponse, error)
}

Server is ActionsServiceServer without UnimplementedActionsServiceServer

type UnimplementedActionsServiceServer

type UnimplementedActionsServiceServer struct{}

UnimplementedActionsServiceServer 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 (UnimplementedActionsServiceServer) ApplyAction

type UnsafeActionsServiceServer

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

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

Jump to

Keyboard shortcuts

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