apiv1connect

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// IpamServiceCreatePrefixProcedure is the fully-qualified name of the IpamService's CreatePrefix
	// RPC.
	IpamServiceCreatePrefixProcedure = "/api.v1.IpamService/CreatePrefix"
	// IpamServiceDeletePrefixProcedure is the fully-qualified name of the IpamService's DeletePrefix
	// RPC.
	IpamServiceDeletePrefixProcedure = "/api.v1.IpamService/DeletePrefix"
	// IpamServiceGetPrefixProcedure is the fully-qualified name of the IpamService's GetPrefix RPC.
	IpamServiceGetPrefixProcedure = "/api.v1.IpamService/GetPrefix"
	// IpamServiceListPrefixesProcedure is the fully-qualified name of the IpamService's ListPrefixes
	// RPC.
	IpamServiceListPrefixesProcedure = "/api.v1.IpamService/ListPrefixes"
	// IpamServicePrefixUsageProcedure is the fully-qualified name of the IpamService's PrefixUsage RPC.
	IpamServicePrefixUsageProcedure = "/api.v1.IpamService/PrefixUsage"
	// IpamServiceAcquireChildPrefixProcedure is the fully-qualified name of the IpamService's
	// AcquireChildPrefix RPC.
	IpamServiceAcquireChildPrefixProcedure = "/api.v1.IpamService/AcquireChildPrefix"
	// IpamServiceReleaseChildPrefixProcedure is the fully-qualified name of the IpamService's
	// ReleaseChildPrefix RPC.
	IpamServiceReleaseChildPrefixProcedure = "/api.v1.IpamService/ReleaseChildPrefix"
	// IpamServiceAcquireIPProcedure is the fully-qualified name of the IpamService's AcquireIP RPC.
	IpamServiceAcquireIPProcedure = "/api.v1.IpamService/AcquireIP"
	// IpamServiceReleaseIPProcedure is the fully-qualified name of the IpamService's ReleaseIP RPC.
	IpamServiceReleaseIPProcedure = "/api.v1.IpamService/ReleaseIP"
	// IpamServiceDumpProcedure is the fully-qualified name of the IpamService's Dump RPC.
	IpamServiceDumpProcedure = "/api.v1.IpamService/Dump"
	// IpamServiceLoadProcedure is the fully-qualified name of the IpamService's Load RPC.
	IpamServiceLoadProcedure = "/api.v1.IpamService/Load"
	// IpamServiceCreateNamespaceProcedure is the fully-qualified name of the IpamService's
	// CreateNamespace RPC.
	IpamServiceCreateNamespaceProcedure = "/api.v1.IpamService/CreateNamespace"
	// IpamServiceListNamespacesProcedure is the fully-qualified name of the IpamService's
	// ListNamespaces RPC.
	IpamServiceListNamespacesProcedure = "/api.v1.IpamService/ListNamespaces"
	// IpamServiceDeleteNamespaceProcedure is the fully-qualified name of the IpamService's
	// DeleteNamespace RPC.
	IpamServiceDeleteNamespaceProcedure = "/api.v1.IpamService/DeleteNamespace"
)

These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.

Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.

View Source
const (
	// IpamServiceName is the fully-qualified name of the IpamService service.
	IpamServiceName = "api.v1.IpamService"
)

Variables

This section is empty.

Functions

func NewIpamServiceHandler

func NewIpamServiceHandler(svc IpamServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewIpamServiceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

Types

type IpamServiceClient

type IpamServiceClient interface {
	CreatePrefix(context.Context, *connect.Request[v1.CreatePrefixRequest]) (*connect.Response[v1.CreatePrefixResponse], error)
	DeletePrefix(context.Context, *connect.Request[v1.DeletePrefixRequest]) (*connect.Response[v1.DeletePrefixResponse], error)
	GetPrefix(context.Context, *connect.Request[v1.GetPrefixRequest]) (*connect.Response[v1.GetPrefixResponse], error)
	ListPrefixes(context.Context, *connect.Request[v1.ListPrefixesRequest]) (*connect.Response[v1.ListPrefixesResponse], error)
	PrefixUsage(context.Context, *connect.Request[v1.PrefixUsageRequest]) (*connect.Response[v1.PrefixUsageResponse], error)
	AcquireChildPrefix(context.Context, *connect.Request[v1.AcquireChildPrefixRequest]) (*connect.Response[v1.AcquireChildPrefixResponse], error)
	ReleaseChildPrefix(context.Context, *connect.Request[v1.ReleaseChildPrefixRequest]) (*connect.Response[v1.ReleaseChildPrefixResponse], error)
	AcquireIP(context.Context, *connect.Request[v1.AcquireIPRequest]) (*connect.Response[v1.AcquireIPResponse], error)
	ReleaseIP(context.Context, *connect.Request[v1.ReleaseIPRequest]) (*connect.Response[v1.ReleaseIPResponse], error)
	Dump(context.Context, *connect.Request[v1.DumpRequest]) (*connect.Response[v1.DumpResponse], error)
	Load(context.Context, *connect.Request[v1.LoadRequest]) (*connect.Response[v1.LoadResponse], error)
	CreateNamespace(context.Context, *connect.Request[v1.CreateNamespaceRequest]) (*connect.Response[v1.CreateNamespaceResponse], error)
	ListNamespaces(context.Context, *connect.Request[v1.ListNamespacesRequest]) (*connect.Response[v1.ListNamespacesResponse], error)
	DeleteNamespace(context.Context, *connect.Request[v1.DeleteNamespaceRequest]) (*connect.Response[v1.DeleteNamespaceResponse], error)
}

IpamServiceClient is a client for the api.v1.IpamService service.

func NewIpamServiceClient

func NewIpamServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) IpamServiceClient

NewIpamServiceClient constructs a client for the api.v1.IpamService service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type IpamServiceHandler

type IpamServiceHandler interface {
	CreatePrefix(context.Context, *connect.Request[v1.CreatePrefixRequest]) (*connect.Response[v1.CreatePrefixResponse], error)
	DeletePrefix(context.Context, *connect.Request[v1.DeletePrefixRequest]) (*connect.Response[v1.DeletePrefixResponse], error)
	GetPrefix(context.Context, *connect.Request[v1.GetPrefixRequest]) (*connect.Response[v1.GetPrefixResponse], error)
	ListPrefixes(context.Context, *connect.Request[v1.ListPrefixesRequest]) (*connect.Response[v1.ListPrefixesResponse], error)
	PrefixUsage(context.Context, *connect.Request[v1.PrefixUsageRequest]) (*connect.Response[v1.PrefixUsageResponse], error)
	AcquireChildPrefix(context.Context, *connect.Request[v1.AcquireChildPrefixRequest]) (*connect.Response[v1.AcquireChildPrefixResponse], error)
	ReleaseChildPrefix(context.Context, *connect.Request[v1.ReleaseChildPrefixRequest]) (*connect.Response[v1.ReleaseChildPrefixResponse], error)
	AcquireIP(context.Context, *connect.Request[v1.AcquireIPRequest]) (*connect.Response[v1.AcquireIPResponse], error)
	ReleaseIP(context.Context, *connect.Request[v1.ReleaseIPRequest]) (*connect.Response[v1.ReleaseIPResponse], error)
	Dump(context.Context, *connect.Request[v1.DumpRequest]) (*connect.Response[v1.DumpResponse], error)
	Load(context.Context, *connect.Request[v1.LoadRequest]) (*connect.Response[v1.LoadResponse], error)
	CreateNamespace(context.Context, *connect.Request[v1.CreateNamespaceRequest]) (*connect.Response[v1.CreateNamespaceResponse], error)
	ListNamespaces(context.Context, *connect.Request[v1.ListNamespacesRequest]) (*connect.Response[v1.ListNamespacesResponse], error)
	DeleteNamespace(context.Context, *connect.Request[v1.DeleteNamespaceRequest]) (*connect.Response[v1.DeleteNamespaceResponse], error)
}

IpamServiceHandler is an implementation of the api.v1.IpamService service.

type UnimplementedIpamServiceHandler

type UnimplementedIpamServiceHandler struct{}

UnimplementedIpamServiceHandler returns CodeUnimplemented from all methods.

func (UnimplementedIpamServiceHandler) CreateNamespace added in v1.12.0

func (UnimplementedIpamServiceHandler) DeleteNamespace added in v1.12.0

func (UnimplementedIpamServiceHandler) Dump

func (UnimplementedIpamServiceHandler) ListNamespaces added in v1.12.0

func (UnimplementedIpamServiceHandler) Load

func (UnimplementedIpamServiceHandler) PrefixUsage added in v1.11.1

Jump to

Keyboard shortcuts

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