agentv1

package
v0.0.0-...-e27afb6 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package agentv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var AgentAPI_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "aetherfs.agent.v1.AgentAPI",
	HandlerType: (*AgentAPIServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Publish",
			Handler:    _AgentAPI_Publish_Handler,
		},
		{
			MethodName: "Subscribe",
			Handler:    _AgentAPI_Subscribe_Handler,
		},
		{
			MethodName: "GracefulShutdown",
			Handler:    _AgentAPI_GracefulShutdown_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "WatchSubscription",
			Handler:       _AgentAPI_WatchSubscription_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "aetherfs/agent/v1/api.proto",
}

AgentAPI_ServiceDesc is the grpc.ServiceDesc for AgentAPI 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_aetherfs_agent_v1_api_proto protoreflect.FileDescriptor

Functions

func RegisterAgentAPIHandler

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

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

func RegisterAgentAPIHandlerClient

func RegisterAgentAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AgentAPIClient) error

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

func RegisterAgentAPIHandlerFromEndpoint

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

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

func RegisterAgentAPIHandlerServer

func RegisterAgentAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AgentAPIServer) error

RegisterAgentAPIHandlerServer registers the http handlers for service AgentAPI to "mux". UnaryRPC :call AgentAPIServer 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 RegisterAgentAPIHandlerFromEndpoint instead.

func RegisterAgentAPIServer

func RegisterAgentAPIServer(s grpc.ServiceRegistrar, srv AgentAPIServer)

Types

type AgentAPIClient

type AgentAPIClient interface {
	Publish(ctx context.Context, in *PublishRequest, opts ...grpc.CallOption) (*PublishResponse, error)
	Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (*SubscribeResponse, error)
	GracefulShutdown(ctx context.Context, in *GracefulShutdownRequest, opts ...grpc.CallOption) (*GracefulShutdownResponse, error)
	WatchSubscription(ctx context.Context, opts ...grpc.CallOption) (AgentAPI_WatchSubscriptionClient, error)
}

AgentAPIClient is the client API for AgentAPI 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.

func NewAgentAPIClient

func NewAgentAPIClient(cc grpc.ClientConnInterface) AgentAPIClient

type AgentAPIServer

type AgentAPIServer interface {
	Publish(context.Context, *PublishRequest) (*PublishResponse, error)
	Subscribe(context.Context, *SubscribeRequest) (*SubscribeResponse, error)
	GracefulShutdown(context.Context, *GracefulShutdownRequest) (*GracefulShutdownResponse, error)
	WatchSubscription(AgentAPI_WatchSubscriptionServer) error
	// contains filtered or unexported methods
}

AgentAPIServer is the server API for AgentAPI service. All implementations must embed UnimplementedAgentAPIServer for forward compatibility

type AgentAPI_WatchSubscriptionClient

type AgentAPI_WatchSubscriptionClient interface {
	Send(*WatchSubscriptionRequest) error
	Recv() (*WatchSubscriptionResponse, error)
	grpc.ClientStream
}

type AgentAPI_WatchSubscriptionServer

type AgentAPI_WatchSubscriptionServer interface {
	Send(*WatchSubscriptionResponse) error
	Recv() (*WatchSubscriptionRequest, error)
	grpc.ServerStream
}

type GracefulShutdownRequest

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

GracefulShutdownRequest is used to initiate a graceful shutdown of the agent process. This will wait for all published datasets to be replicated before returning and then shutting down.

func (*GracefulShutdownRequest) Descriptor deprecated

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

Deprecated: Use GracefulShutdownRequest.ProtoReflect.Descriptor instead.

func (*GracefulShutdownRequest) ProtoMessage

func (*GracefulShutdownRequest) ProtoMessage()

func (*GracefulShutdownRequest) ProtoReflect

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

func (*GracefulShutdownRequest) Reset

func (x *GracefulShutdownRequest) Reset()

func (*GracefulShutdownRequest) String

func (x *GracefulShutdownRequest) String() string

type GracefulShutdownResponse

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

GracefulShutdownResponse is returned when all

func (*GracefulShutdownResponse) Descriptor deprecated

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

Deprecated: Use GracefulShutdownResponse.ProtoReflect.Descriptor instead.

func (*GracefulShutdownResponse) ProtoMessage

func (*GracefulShutdownResponse) ProtoMessage()

func (*GracefulShutdownResponse) ProtoReflect

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

func (*GracefulShutdownResponse) Reset

func (x *GracefulShutdownResponse) Reset()

func (*GracefulShutdownResponse) String

func (x *GracefulShutdownResponse) String() string

type PublishRequest

type PublishRequest struct {
	Sync      bool     `protobuf:"varint,1,opt,name=sync,proto3" json:"sync,omitempty"`
	Path      string   `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	Tags      []string `protobuf:"bytes,3,rep,name=tags,proto3" json:"tags,omitempty"`
	BlockSize int32    `protobuf:"varint,4,opt,name=block_size,json=blockSize,proto3" json:"block_size,omitempty"`
	// contains filtered or unexported fields
}

PublishRequest instructs the agent to publish the dataset found at the provided path with the associated tags.

func (*PublishRequest) Descriptor deprecated

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

Deprecated: Use PublishRequest.ProtoReflect.Descriptor instead.

func (*PublishRequest) GetBlockSize

func (x *PublishRequest) GetBlockSize() int32

func (*PublishRequest) GetPath

func (x *PublishRequest) GetPath() string

func (*PublishRequest) GetSync

func (x *PublishRequest) GetSync() bool

func (*PublishRequest) GetTags

func (x *PublishRequest) GetTags() []string

func (*PublishRequest) ProtoMessage

func (*PublishRequest) ProtoMessage()

func (*PublishRequest) ProtoReflect

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

func (*PublishRequest) Reset

func (x *PublishRequest) Reset()

func (*PublishRequest) String

func (x *PublishRequest) String() string

type PublishResponse

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

PublishResponse is returned when the dataset has been published when the operation is synchronous.

func (*PublishResponse) Descriptor deprecated

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

Deprecated: Use PublishResponse.ProtoReflect.Descriptor instead.

func (*PublishResponse) ProtoMessage

func (*PublishResponse) ProtoMessage()

func (*PublishResponse) ProtoReflect

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

func (*PublishResponse) Reset

func (x *PublishResponse) Reset()

func (*PublishResponse) String

func (x *PublishResponse) String() string

type SubscribeRequest

type SubscribeRequest struct {
	Sync bool     `protobuf:"varint,1,opt,name=sync,proto3" json:"sync,omitempty"`
	Path string   `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	Tags []string `protobuf:"bytes,3,rep,name=tags,proto3" json:"tags,omitempty"`
	// contains filtered or unexported fields
}

SubscribeRequest is used to programmatically subscribe to dataset updates. Consumers can use this to get notified of when new versions of datasets become available.

func (*SubscribeRequest) Descriptor deprecated

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

Deprecated: Use SubscribeRequest.ProtoReflect.Descriptor instead.

func (*SubscribeRequest) GetPath

func (x *SubscribeRequest) GetPath() string

func (*SubscribeRequest) GetSync

func (x *SubscribeRequest) GetSync() bool

func (*SubscribeRequest) GetTags

func (x *SubscribeRequest) GetTags() []string

func (*SubscribeRequest) ProtoMessage

func (*SubscribeRequest) ProtoMessage()

func (*SubscribeRequest) ProtoReflect

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

func (*SubscribeRequest) Reset

func (x *SubscribeRequest) Reset()

func (*SubscribeRequest) String

func (x *SubscribeRequest) String() string

type SubscribeResponse

type SubscribeResponse struct {
	Paths map[string]string `` /* 151-byte string literal not displayed */
	// contains filtered or unexported fields
}

SubscribeResponse returns a mapping of tags to paths where the dataset can be found.

func (*SubscribeResponse) Descriptor deprecated

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

Deprecated: Use SubscribeResponse.ProtoReflect.Descriptor instead.

func (*SubscribeResponse) GetPaths

func (x *SubscribeResponse) GetPaths() map[string]string

func (*SubscribeResponse) ProtoMessage

func (*SubscribeResponse) ProtoMessage()

func (*SubscribeResponse) ProtoReflect

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

func (*SubscribeResponse) Reset

func (x *SubscribeResponse) Reset()

func (*SubscribeResponse) String

func (x *SubscribeResponse) String() string

type UnimplementedAgentAPIServer

type UnimplementedAgentAPIServer struct {
}

UnimplementedAgentAPIServer must be embedded to have forward compatible implementations.

func (UnimplementedAgentAPIServer) GracefulShutdown

func (UnimplementedAgentAPIServer) Publish

func (UnimplementedAgentAPIServer) Subscribe

func (UnimplementedAgentAPIServer) WatchSubscription

type UnsafeAgentAPIServer

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

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

type WatchSubscriptionRequest

type WatchSubscriptionRequest struct {
	Subscription *SubscribeRequest `protobuf:"bytes,1,opt,name=subscription,proto3" json:"subscription,omitempty"`
	Cancel       bool              `protobuf:"varint,2,opt,name=cancel,proto3" json:"cancel,omitempty"`
	// contains filtered or unexported fields
}

WatchSubscriptionRequest wraps the SubscribeRequest for streaming.

func (*WatchSubscriptionRequest) Descriptor deprecated

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

Deprecated: Use WatchSubscriptionRequest.ProtoReflect.Descriptor instead.

func (*WatchSubscriptionRequest) GetCancel

func (x *WatchSubscriptionRequest) GetCancel() bool

func (*WatchSubscriptionRequest) GetSubscription

func (x *WatchSubscriptionRequest) GetSubscription() *SubscribeRequest

func (*WatchSubscriptionRequest) ProtoMessage

func (*WatchSubscriptionRequest) ProtoMessage()

func (*WatchSubscriptionRequest) ProtoReflect

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

func (*WatchSubscriptionRequest) Reset

func (x *WatchSubscriptionRequest) Reset()

func (*WatchSubscriptionRequest) String

func (x *WatchSubscriptionRequest) String() string

type WatchSubscriptionResponse

type WatchSubscriptionResponse struct {
	Subscription *SubscribeResponse `protobuf:"bytes,1,opt,name=subscription,proto3" json:"subscription,omitempty"`
	Cancelled    bool               `protobuf:"varint,2,opt,name=cancelled,proto3" json:"cancelled,omitempty"`
	// contains filtered or unexported fields
}

WatchSubscriptionResponse returns information dynamically when a new version of a dataset becomes available.

func (*WatchSubscriptionResponse) Descriptor deprecated

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

Deprecated: Use WatchSubscriptionResponse.ProtoReflect.Descriptor instead.

func (*WatchSubscriptionResponse) GetCancelled

func (x *WatchSubscriptionResponse) GetCancelled() bool

func (*WatchSubscriptionResponse) GetSubscription

func (x *WatchSubscriptionResponse) GetSubscription() *SubscribeResponse

func (*WatchSubscriptionResponse) ProtoMessage

func (*WatchSubscriptionResponse) ProtoMessage()

func (*WatchSubscriptionResponse) ProtoReflect

func (*WatchSubscriptionResponse) Reset

func (x *WatchSubscriptionResponse) Reset()

func (*WatchSubscriptionResponse) String

func (x *WatchSubscriptionResponse) String() string

Jump to

Keyboard shortcuts

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