capb

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2020 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package capb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

Functions

func RegisterCSRHandler

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

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

func RegisterCSRHandlerClient

func RegisterCSRHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CSRClient) error

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

func RegisterCSRHandlerFromEndpoint

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

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

func RegisterCSRHandlerServer

func RegisterCSRHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CSRServer) error

RegisterCSRHandlerServer registers the http handlers for service CSR to "mux". UnaryRPC :call CSRServer 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 RegisterCSRHandlerFromEndpoint instead.

func RegisterCSRServer

func RegisterCSRServer(s grpc.ServiceRegistrar, srv CSRServer)

Types

type CSRClient

type CSRClient interface {
	SignCertificate(ctx context.Context, in *SignCertificateRequest, opts ...grpc.CallOption) (*SignCertificateResponse, error)
}

CSRClient is the client API for CSR 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 NewCSRClient

func NewCSRClient(cc grpc.ClientConnInterface) CSRClient

type CSRData

type CSRData struct {
	Addresses []string `protobuf:"bytes,1,rep,name=addresses,proto3" json:"addresses,omitempty"`
	Domains   []string `protobuf:"bytes,2,rep,name=domains,proto3" json:"domains,omitempty"`
	PublicKey []byte   `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
	Subject   string   `protobuf:"bytes,4,opt,name=subject,proto3" json:"subject,omitempty"`
	// contains filtered or unexported fields
}

func (*CSRData) Descriptor deprecated

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

Deprecated: Use CSRData.ProtoReflect.Descriptor instead.

func (*CSRData) GetAddresses

func (x *CSRData) GetAddresses() []string

func (*CSRData) GetDomains

func (x *CSRData) GetDomains() []string

func (*CSRData) GetPublicKey

func (x *CSRData) GetPublicKey() []byte

func (*CSRData) GetSubject

func (x *CSRData) GetSubject() string

func (*CSRData) ProtoMessage

func (*CSRData) ProtoMessage()

func (*CSRData) ProtoReflect

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

func (*CSRData) Reset

func (x *CSRData) Reset()

func (*CSRData) String

func (x *CSRData) String() string

type CSRServer

type CSRServer interface {
	SignCertificate(context.Context, *SignCertificateRequest) (*SignCertificateResponse, error)
	// contains filtered or unexported methods
}

CSRServer is the server API for CSR service. All implementations must embed UnimplementedCSRServer for forward compatibility

type SignCertificateRequest

type SignCertificateRequest struct {
	Csr *CSRData `protobuf:"bytes,1,opt,name=csr,proto3" json:"csr,omitempty"`
	// contains filtered or unexported fields
}

func (*SignCertificateRequest) Descriptor deprecated

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

Deprecated: Use SignCertificateRequest.ProtoReflect.Descriptor instead.

func (*SignCertificateRequest) GetCsr

func (x *SignCertificateRequest) GetCsr() *CSRData

func (*SignCertificateRequest) ProtoMessage

func (*SignCertificateRequest) ProtoMessage()

func (*SignCertificateRequest) ProtoReflect

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

func (*SignCertificateRequest) Reset

func (x *SignCertificateRequest) Reset()

func (*SignCertificateRequest) String

func (x *SignCertificateRequest) String() string

type SignCertificateResponse

type SignCertificateResponse struct {
	RawCertificate []byte `protobuf:"bytes,1,opt,name=raw_certificate,json=rawCertificate,proto3" json:"raw_certificate,omitempty"`
	// contains filtered or unexported fields
}

func (*SignCertificateResponse) Descriptor deprecated

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

Deprecated: Use SignCertificateResponse.ProtoReflect.Descriptor instead.

func (*SignCertificateResponse) GetRawCertificate

func (x *SignCertificateResponse) GetRawCertificate() []byte

func (*SignCertificateResponse) ProtoMessage

func (*SignCertificateResponse) ProtoMessage()

func (*SignCertificateResponse) ProtoReflect

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

func (*SignCertificateResponse) Reset

func (x *SignCertificateResponse) Reset()

func (*SignCertificateResponse) String

func (x *SignCertificateResponse) String() string

type UnimplementedCSRServer

type UnimplementedCSRServer struct {
}

UnimplementedCSRServer must be embedded to have forward compatible implementations.

func (UnimplementedCSRServer) SignCertificate

type UnsafeCSRServer

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

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

Jump to

Keyboard shortcuts

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