naming lint (#463)

This commit is contained in:
Michael Quigley 2024-09-18 11:54:37 -04:00
parent edf40ca2b5
commit 0a0d6402c1
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
15 changed files with 938 additions and 935 deletions

View File

@ -10,7 +10,7 @@ import (
"os"
)
func (i *agentGrpcImpl) PrivateAccess(_ context.Context, req *agentGrpc.PrivateAccessRequest) (*agentGrpc.PrivateAccessReply, error) {
func (i *agentGrpcImpl) AccessPrivate(_ context.Context, req *agentGrpc.AccessPrivateRequest) (*agentGrpc.AccessPrivateResponse, error) {
root, err := environment.LoadRoot()
if err != nil {
return nil, err
@ -41,7 +41,7 @@ func (i *agentGrpcImpl) PrivateAccess(_ context.Context, req *agentGrpc.PrivateA
if acc.bootErr == nil {
i.a.inAccesses <- acc
return &agentGrpc.PrivateAccessReply{FrontendToken: acc.frontendToken}, nil
return &agentGrpc.AccessPrivateResponse{FrontendToken: acc.frontendToken}, nil
}
return nil, acc.bootErr

File diff suppressed because it is too large Load Diff

View File

@ -3,14 +3,14 @@ syntax = "proto3";
option go_package = "github.com/openziti/zrok/agent/agentGrpc";
service Agent {
rpc PrivateAccess(PrivateAccessRequest) returns (PrivateAccessReply) {}
rpc PrivateShare(PrivateShareRequest) returns (PrivateShareReply) {}
rpc PublicShare(PublicShareRequest) returns (PublicShareReply) {}
rpc ReleaseAccess(ReleaseAccessRequest) returns (ReleaseAccessReply) {}
rpc ReleaseShare(ReleaseShareRequest) returns (ReleaseShareReply) {}
rpc ReservedShare(ReservedShareRequest) returns (ReservedShareReply) {}
rpc Status(StatusRequest) returns (StatusReply) {}
rpc Version(VersionRequest) returns (VersionReply) {}
rpc AccessPrivate(AccessPrivateRequest) returns (AccessPrivateResponse) {}
rpc ReleaseAccess(ReleaseAccessRequest) returns (ReleaseAccessResponse) {}
rpc ReleaseShare(ReleaseShareRequest) returns (ReleaseShareResponse) {}
rpc ShareReserved(ShareReservedRequest) returns (ShareReservedResponse) {}
rpc SharePrivate(SharePrivateRequest) returns (SharePrivateResponse) {}
rpc SharePublic(SharePublicRequest) returns (SharePublicResponse) {}
rpc Status(StatusRequest) returns (StatusResponse) {}
rpc Version(VersionRequest) returns (VersionResponse) {}
}
message AccessDetail {
@ -20,72 +20,28 @@ message AccessDetail {
repeated string responseHeaders = 4;
}
message PrivateAccessReply{
message AccessPrivateResponse{
string frontendToken = 1;
}
message PrivateAccessRequest{
message AccessPrivateRequest{
string token = 1;
string bindAddress = 2;
repeated string responseHeaders = 3;
}
message PrivateShareReply {
string token = 1;
}
message PrivateShareRequest {
string target = 1;
string backendMode = 2;
bool insecure = 3;
bool closed = 4;
repeated string accessGrants = 5;
}
message PublicShareReply {
string token = 1;
repeated string frontendEndpoints = 2;
}
message PublicShareRequest {
string target = 1;
repeated string basicAuth = 2;
repeated string frontendSelection = 3;
string backendMode = 4;
bool insecure = 5;
string oauthProvider = 6;
repeated string oauthEmailAddressPatterns = 7;
string oauthCheckInterval = 8;
bool closed = 9;
repeated string accessGrants = 10;
}
message ReleaseAccessRequest {
string frontendToken = 1;
}
message ReleaseAccessReply {
message ReleaseAccessResponse {
}
message ReleaseShareRequest {
string token = 1;
}
message ReleaseShareReply {
}
message ReservedShareReply {
string token = 1;
string backendMode = 2;
string shareMode = 3;
repeated string frontendEndpoints = 4;
string target = 5;
}
message ReservedShareRequest {
string token = 1;
string overrideEndpoint = 2;
bool insecure = 3;
message ReleaseShareResponse {
}
message ShareDetail {
@ -99,10 +55,54 @@ message ShareDetail {
string status = 8;
}
message SharePrivateRequest {
string target = 1;
string backendMode = 2;
bool insecure = 3;
bool closed = 4;
repeated string accessGrants = 5;
}
message SharePrivateResponse {
string token = 1;
}
message SharePublicRequest {
string target = 1;
repeated string basicAuth = 2;
repeated string frontendSelection = 3;
string backendMode = 4;
bool insecure = 5;
string oauthProvider = 6;
repeated string oauthEmailAddressPatterns = 7;
string oauthCheckInterval = 8;
bool closed = 9;
repeated string accessGrants = 10;
}
message SharePublicResponse {
string token = 1;
repeated string frontendEndpoints = 2;
}
message ShareReservedRequest {
string token = 1;
string overrideEndpoint = 2;
bool insecure = 3;
}
message ShareReservedResponse {
string token = 1;
string backendMode = 2;
string shareMode = 3;
repeated string frontendEndpoints = 4;
string target = 5;
}
message StatusRequest {
}
message StatusReply {
message StatusResponse {
repeated AccessDetail accesses = 1;
repeated ShareDetail shares = 2;
}
@ -110,6 +110,6 @@ message StatusReply {
message VersionRequest {
}
message VersionReply {
message VersionResponse {
string v = 1;
}

View File

@ -19,12 +19,12 @@ import (
const _ = grpc.SupportPackageIsVersion9
const (
Agent_PrivateAccess_FullMethodName = "/Agent/PrivateAccess"
Agent_PrivateShare_FullMethodName = "/Agent/PrivateShare"
Agent_PublicShare_FullMethodName = "/Agent/PublicShare"
Agent_AccessPrivate_FullMethodName = "/Agent/AccessPrivate"
Agent_ReleaseAccess_FullMethodName = "/Agent/ReleaseAccess"
Agent_ReleaseShare_FullMethodName = "/Agent/ReleaseShare"
Agent_ReservedShare_FullMethodName = "/Agent/ReservedShare"
Agent_ShareReserved_FullMethodName = "/Agent/ShareReserved"
Agent_SharePrivate_FullMethodName = "/Agent/SharePrivate"
Agent_SharePublic_FullMethodName = "/Agent/SharePublic"
Agent_Status_FullMethodName = "/Agent/Status"
Agent_Version_FullMethodName = "/Agent/Version"
)
@ -33,14 +33,14 @@ const (
//
// 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 AgentClient interface {
PrivateAccess(ctx context.Context, in *PrivateAccessRequest, opts ...grpc.CallOption) (*PrivateAccessReply, error)
PrivateShare(ctx context.Context, in *PrivateShareRequest, opts ...grpc.CallOption) (*PrivateShareReply, error)
PublicShare(ctx context.Context, in *PublicShareRequest, opts ...grpc.CallOption) (*PublicShareReply, error)
ReleaseAccess(ctx context.Context, in *ReleaseAccessRequest, opts ...grpc.CallOption) (*ReleaseAccessReply, error)
ReleaseShare(ctx context.Context, in *ReleaseShareRequest, opts ...grpc.CallOption) (*ReleaseShareReply, error)
ReservedShare(ctx context.Context, in *ReservedShareRequest, opts ...grpc.CallOption) (*ReservedShareReply, error)
Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusReply, error)
Version(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*VersionReply, error)
AccessPrivate(ctx context.Context, in *AccessPrivateRequest, opts ...grpc.CallOption) (*AccessPrivateResponse, error)
ReleaseAccess(ctx context.Context, in *ReleaseAccessRequest, opts ...grpc.CallOption) (*ReleaseAccessResponse, error)
ReleaseShare(ctx context.Context, in *ReleaseShareRequest, opts ...grpc.CallOption) (*ReleaseShareResponse, error)
ShareReserved(ctx context.Context, in *ShareReservedRequest, opts ...grpc.CallOption) (*ShareReservedResponse, error)
SharePrivate(ctx context.Context, in *SharePrivateRequest, opts ...grpc.CallOption) (*SharePrivateResponse, error)
SharePublic(ctx context.Context, in *SharePublicRequest, opts ...grpc.CallOption) (*SharePublicResponse, error)
Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error)
Version(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*VersionResponse, error)
}
type agentClient struct {
@ -51,39 +51,19 @@ func NewAgentClient(cc grpc.ClientConnInterface) AgentClient {
return &agentClient{cc}
}
func (c *agentClient) PrivateAccess(ctx context.Context, in *PrivateAccessRequest, opts ...grpc.CallOption) (*PrivateAccessReply, error) {
func (c *agentClient) AccessPrivate(ctx context.Context, in *AccessPrivateRequest, opts ...grpc.CallOption) (*AccessPrivateResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(PrivateAccessReply)
err := c.cc.Invoke(ctx, Agent_PrivateAccess_FullMethodName, in, out, cOpts...)
out := new(AccessPrivateResponse)
err := c.cc.Invoke(ctx, Agent_AccessPrivate_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *agentClient) PrivateShare(ctx context.Context, in *PrivateShareRequest, opts ...grpc.CallOption) (*PrivateShareReply, error) {
func (c *agentClient) ReleaseAccess(ctx context.Context, in *ReleaseAccessRequest, opts ...grpc.CallOption) (*ReleaseAccessResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(PrivateShareReply)
err := c.cc.Invoke(ctx, Agent_PrivateShare_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *agentClient) PublicShare(ctx context.Context, in *PublicShareRequest, opts ...grpc.CallOption) (*PublicShareReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(PublicShareReply)
err := c.cc.Invoke(ctx, Agent_PublicShare_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *agentClient) ReleaseAccess(ctx context.Context, in *ReleaseAccessRequest, opts ...grpc.CallOption) (*ReleaseAccessReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ReleaseAccessReply)
out := new(ReleaseAccessResponse)
err := c.cc.Invoke(ctx, Agent_ReleaseAccess_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@ -91,9 +71,9 @@ func (c *agentClient) ReleaseAccess(ctx context.Context, in *ReleaseAccessReques
return out, nil
}
func (c *agentClient) ReleaseShare(ctx context.Context, in *ReleaseShareRequest, opts ...grpc.CallOption) (*ReleaseShareReply, error) {
func (c *agentClient) ReleaseShare(ctx context.Context, in *ReleaseShareRequest, opts ...grpc.CallOption) (*ReleaseShareResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ReleaseShareReply)
out := new(ReleaseShareResponse)
err := c.cc.Invoke(ctx, Agent_ReleaseShare_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@ -101,19 +81,39 @@ func (c *agentClient) ReleaseShare(ctx context.Context, in *ReleaseShareRequest,
return out, nil
}
func (c *agentClient) ReservedShare(ctx context.Context, in *ReservedShareRequest, opts ...grpc.CallOption) (*ReservedShareReply, error) {
func (c *agentClient) ShareReserved(ctx context.Context, in *ShareReservedRequest, opts ...grpc.CallOption) (*ShareReservedResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ReservedShareReply)
err := c.cc.Invoke(ctx, Agent_ReservedShare_FullMethodName, in, out, cOpts...)
out := new(ShareReservedResponse)
err := c.cc.Invoke(ctx, Agent_ShareReserved_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *agentClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusReply, error) {
func (c *agentClient) SharePrivate(ctx context.Context, in *SharePrivateRequest, opts ...grpc.CallOption) (*SharePrivateResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
out := new(SharePrivateResponse)
err := c.cc.Invoke(ctx, Agent_SharePrivate_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *agentClient) SharePublic(ctx context.Context, in *SharePublicRequest, opts ...grpc.CallOption) (*SharePublicResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(SharePublicResponse)
err := c.cc.Invoke(ctx, Agent_SharePublic_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *agentClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusResponse)
err := c.cc.Invoke(ctx, Agent_Status_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@ -121,9 +121,9 @@ func (c *agentClient) Status(ctx context.Context, in *StatusRequest, opts ...grp
return out, nil
}
func (c *agentClient) Version(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*VersionReply, error) {
func (c *agentClient) Version(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*VersionResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(VersionReply)
out := new(VersionResponse)
err := c.cc.Invoke(ctx, Agent_Version_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@ -135,14 +135,14 @@ func (c *agentClient) Version(ctx context.Context, in *VersionRequest, opts ...g
// All implementations must embed UnimplementedAgentServer
// for forward compatibility.
type AgentServer interface {
PrivateAccess(context.Context, *PrivateAccessRequest) (*PrivateAccessReply, error)
PrivateShare(context.Context, *PrivateShareRequest) (*PrivateShareReply, error)
PublicShare(context.Context, *PublicShareRequest) (*PublicShareReply, error)
ReleaseAccess(context.Context, *ReleaseAccessRequest) (*ReleaseAccessReply, error)
ReleaseShare(context.Context, *ReleaseShareRequest) (*ReleaseShareReply, error)
ReservedShare(context.Context, *ReservedShareRequest) (*ReservedShareReply, error)
Status(context.Context, *StatusRequest) (*StatusReply, error)
Version(context.Context, *VersionRequest) (*VersionReply, error)
AccessPrivate(context.Context, *AccessPrivateRequest) (*AccessPrivateResponse, error)
ReleaseAccess(context.Context, *ReleaseAccessRequest) (*ReleaseAccessResponse, error)
ReleaseShare(context.Context, *ReleaseShareRequest) (*ReleaseShareResponse, error)
ShareReserved(context.Context, *ShareReservedRequest) (*ShareReservedResponse, error)
SharePrivate(context.Context, *SharePrivateRequest) (*SharePrivateResponse, error)
SharePublic(context.Context, *SharePublicRequest) (*SharePublicResponse, error)
Status(context.Context, *StatusRequest) (*StatusResponse, error)
Version(context.Context, *VersionRequest) (*VersionResponse, error)
mustEmbedUnimplementedAgentServer()
}
@ -153,28 +153,28 @@ type AgentServer interface {
// pointer dereference when methods are called.
type UnimplementedAgentServer struct{}
func (UnimplementedAgentServer) PrivateAccess(context.Context, *PrivateAccessRequest) (*PrivateAccessReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method PrivateAccess not implemented")
func (UnimplementedAgentServer) AccessPrivate(context.Context, *AccessPrivateRequest) (*AccessPrivateResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method AccessPrivate not implemented")
}
func (UnimplementedAgentServer) PrivateShare(context.Context, *PrivateShareRequest) (*PrivateShareReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method PrivateShare not implemented")
}
func (UnimplementedAgentServer) PublicShare(context.Context, *PublicShareRequest) (*PublicShareReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method PublicShare not implemented")
}
func (UnimplementedAgentServer) ReleaseAccess(context.Context, *ReleaseAccessRequest) (*ReleaseAccessReply, error) {
func (UnimplementedAgentServer) ReleaseAccess(context.Context, *ReleaseAccessRequest) (*ReleaseAccessResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ReleaseAccess not implemented")
}
func (UnimplementedAgentServer) ReleaseShare(context.Context, *ReleaseShareRequest) (*ReleaseShareReply, error) {
func (UnimplementedAgentServer) ReleaseShare(context.Context, *ReleaseShareRequest) (*ReleaseShareResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ReleaseShare not implemented")
}
func (UnimplementedAgentServer) ReservedShare(context.Context, *ReservedShareRequest) (*ReservedShareReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method ReservedShare not implemented")
func (UnimplementedAgentServer) ShareReserved(context.Context, *ShareReservedRequest) (*ShareReservedResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ShareReserved not implemented")
}
func (UnimplementedAgentServer) Status(context.Context, *StatusRequest) (*StatusReply, error) {
func (UnimplementedAgentServer) SharePrivate(context.Context, *SharePrivateRequest) (*SharePrivateResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SharePrivate not implemented")
}
func (UnimplementedAgentServer) SharePublic(context.Context, *SharePublicRequest) (*SharePublicResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SharePublic not implemented")
}
func (UnimplementedAgentServer) Status(context.Context, *StatusRequest) (*StatusResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Status not implemented")
}
func (UnimplementedAgentServer) Version(context.Context, *VersionRequest) (*VersionReply, error) {
func (UnimplementedAgentServer) Version(context.Context, *VersionRequest) (*VersionResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Version not implemented")
}
func (UnimplementedAgentServer) mustEmbedUnimplementedAgentServer() {}
@ -198,56 +198,20 @@ func RegisterAgentServer(s grpc.ServiceRegistrar, srv AgentServer) {
s.RegisterService(&Agent_ServiceDesc, srv)
}
func _Agent_PrivateAccess_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PrivateAccessRequest)
func _Agent_AccessPrivate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AccessPrivateRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AgentServer).PrivateAccess(ctx, in)
return srv.(AgentServer).AccessPrivate(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Agent_PrivateAccess_FullMethodName,
FullMethod: Agent_AccessPrivate_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AgentServer).PrivateAccess(ctx, req.(*PrivateAccessRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Agent_PrivateShare_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PrivateShareRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AgentServer).PrivateShare(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Agent_PrivateShare_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AgentServer).PrivateShare(ctx, req.(*PrivateShareRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Agent_PublicShare_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PublicShareRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AgentServer).PublicShare(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Agent_PublicShare_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AgentServer).PublicShare(ctx, req.(*PublicShareRequest))
return srv.(AgentServer).AccessPrivate(ctx, req.(*AccessPrivateRequest))
}
return interceptor(ctx, in, info, handler)
}
@ -288,20 +252,56 @@ func _Agent_ReleaseShare_Handler(srv interface{}, ctx context.Context, dec func(
return interceptor(ctx, in, info, handler)
}
func _Agent_ReservedShare_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ReservedShareRequest)
func _Agent_ShareReserved_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ShareReservedRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AgentServer).ReservedShare(ctx, in)
return srv.(AgentServer).ShareReserved(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Agent_ReservedShare_FullMethodName,
FullMethod: Agent_ShareReserved_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AgentServer).ReservedShare(ctx, req.(*ReservedShareRequest))
return srv.(AgentServer).ShareReserved(ctx, req.(*ShareReservedRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Agent_SharePrivate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SharePrivateRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AgentServer).SharePrivate(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Agent_SharePrivate_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AgentServer).SharePrivate(ctx, req.(*SharePrivateRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Agent_SharePublic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SharePublicRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AgentServer).SharePublic(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Agent_SharePublic_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AgentServer).SharePublic(ctx, req.(*SharePublicRequest))
}
return interceptor(ctx, in, info, handler)
}
@ -350,16 +350,8 @@ var Agent_ServiceDesc = grpc.ServiceDesc{
HandlerType: (*AgentServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "PrivateAccess",
Handler: _Agent_PrivateAccess_Handler,
},
{
MethodName: "PrivateShare",
Handler: _Agent_PrivateShare_Handler,
},
{
MethodName: "PublicShare",
Handler: _Agent_PublicShare_Handler,
MethodName: "AccessPrivate",
Handler: _Agent_AccessPrivate_Handler,
},
{
MethodName: "ReleaseAccess",
@ -370,8 +362,16 @@ var Agent_ServiceDesc = grpc.ServiceDesc{
Handler: _Agent_ReleaseShare_Handler,
},
{
MethodName: "ReservedShare",
Handler: _Agent_ReservedShare_Handler,
MethodName: "ShareReserved",
Handler: _Agent_ShareReserved_Handler,
},
{
MethodName: "SharePrivate",
Handler: _Agent_SharePrivate_Handler,
},
{
MethodName: "SharePublic",
Handler: _Agent_SharePublic_Handler,
},
{
MethodName: "Status",

View File

@ -8,7 +8,7 @@ import (
"github.com/sirupsen/logrus"
)
func (i *agentGrpcImpl) ReleaseAccess(_ context.Context, req *agentGrpc.ReleaseAccessRequest) (*agentGrpc.ReleaseAccessReply, error) {
func (i *agentGrpcImpl) ReleaseAccess(_ context.Context, req *agentGrpc.ReleaseAccessRequest) (*agentGrpc.ReleaseAccessResponse, error) {
if acc, found := i.a.accesses[req.FrontendToken]; found {
logrus.Infof("stopping access '%v'", acc.frontendToken)

View File

@ -8,7 +8,7 @@ import (
"github.com/sirupsen/logrus"
)
func (i *agentGrpcImpl) ReleaseShare(_ context.Context, req *agentGrpc.ReleaseShareRequest) (*agentGrpc.ReleaseShareReply, error) {
func (i *agentGrpcImpl) ReleaseShare(_ context.Context, req *agentGrpc.ReleaseShareRequest) (*agentGrpc.ReleaseShareResponse, error) {
if shr, found := i.a.shares[req.Token]; found {
logrus.Infof("stopping share '%v'", shr.token)

View File

@ -11,7 +11,7 @@ import (
"os"
)
func (i *agentGrpcImpl) PrivateShare(_ context.Context, req *agentGrpc.PrivateShareRequest) (*agentGrpc.PrivateShareReply, error) {
func (i *agentGrpcImpl) SharePrivate(_ context.Context, req *agentGrpc.SharePrivateRequest) (*agentGrpc.SharePrivateResponse, error) {
root, err := environment.LoadRoot()
if err != nil {
return nil, err
@ -59,7 +59,7 @@ func (i *agentGrpcImpl) PrivateShare(_ context.Context, req *agentGrpc.PrivateSh
if shr.bootErr == nil {
i.a.inShares <- shr
return &agentGrpc.PrivateShareReply{Token: shr.token}, nil
return &agentGrpc.SharePrivateResponse{Token: shr.token}, nil
}
return nil, shr.bootErr

View File

@ -11,7 +11,7 @@ import (
"os"
)
func (i *agentGrpcImpl) PublicShare(_ context.Context, req *agentGrpc.PublicShareRequest) (*agentGrpc.PublicShareReply, error) {
func (i *agentGrpcImpl) SharePublic(_ context.Context, req *agentGrpc.SharePublicRequest) (*agentGrpc.SharePublicResponse, error) {
root, err := environment.LoadRoot()
if err != nil {
return nil, err
@ -83,7 +83,7 @@ func (i *agentGrpcImpl) PublicShare(_ context.Context, req *agentGrpc.PublicShar
if shr.bootErr == nil {
i.a.inShares <- shr
return &agentGrpc.PublicShareReply{
return &agentGrpc.SharePublicResponse{
Token: shr.token,
FrontendEndpoints: shr.frontendEndpoints,
}, nil

View File

@ -9,7 +9,7 @@ import (
"os"
)
func (i *agentGrpcImpl) ReservedShare(_ context.Context, req *agentGrpc.ReservedShareRequest) (*agentGrpc.ReservedShareReply, error) {
func (i *agentGrpcImpl) ShareReserved(_ context.Context, req *agentGrpc.ShareReservedRequest) (*agentGrpc.ShareReservedResponse, error) {
root, err := environment.LoadRoot()
if err != nil {
return nil, err
@ -48,7 +48,7 @@ func (i *agentGrpcImpl) ReservedShare(_ context.Context, req *agentGrpc.Reserved
if shr.bootErr == nil {
i.a.inShares <- shr
return &agentGrpc.ReservedShareReply{
return &agentGrpc.ShareReservedResponse{
Token: shr.token,
BackendMode: string(shr.backendMode),
ShareMode: string(shr.shareMode),

View File

@ -5,7 +5,7 @@ import (
"github.com/openziti/zrok/agent/agentGrpc"
)
func (i *agentGrpcImpl) Status(_ context.Context, _ *agentGrpc.StatusRequest) (*agentGrpc.StatusReply, error) {
func (i *agentGrpcImpl) Status(_ context.Context, _ *agentGrpc.StatusRequest) (*agentGrpc.StatusResponse, error) {
var accesses []*agentGrpc.AccessDetail
for feToken, acc := range i.a.accesses {
accesses = append(accesses, &agentGrpc.AccessDetail{
@ -29,5 +29,5 @@ func (i *agentGrpcImpl) Status(_ context.Context, _ *agentGrpc.StatusRequest) (*
})
}
return &agentGrpc.StatusReply{Accesses: accesses, Shares: shares}, nil
return &agentGrpc.StatusResponse{Accesses: accesses, Shares: shares}, nil
}

View File

@ -7,8 +7,8 @@ import (
"github.com/sirupsen/logrus"
)
func (i *agentGrpcImpl) Version(_ context.Context, _ *agentGrpc.VersionRequest) (*agentGrpc.VersionReply, error) {
func (i *agentGrpcImpl) Version(_ context.Context, _ *agentGrpc.VersionRequest) (*agentGrpc.VersionResponse, error) {
v := build.String()
logrus.Infof("responding to version inquiry with '%v'", v)
return &agentGrpc.VersionReply{V: v}, nil
return &agentGrpc.VersionResponse{V: v}, nil
}

View File

@ -52,7 +52,7 @@ func (cmd *agentAccessPrivateCommand) run(_ *cobra.Command, args []string) {
}
defer conn.Close()
acc, err := client.PrivateAccess(context.Background(), &agentGrpc.PrivateAccessRequest{
acc, err := client.AccessPrivate(context.Background(), &agentGrpc.AccessPrivateRequest{
Token: args[0],
BindAddress: cmd.bindAddress,
ResponseHeaders: cmd.responseHeaders,

View File

@ -147,7 +147,7 @@ func (cmd *agentSharePrivateCommand) run(_ *cobra.Command, args []string) {
}
defer conn.Close()
shr, err := client.PrivateShare(context.Background(), &agentGrpc.PrivateShareRequest{
shr, err := client.SharePrivate(context.Background(), &agentGrpc.SharePrivateRequest{
Target: target,
BackendMode: cmd.backendMode,
Insecure: cmd.insecure,

View File

@ -124,7 +124,7 @@ func (cmd *agentSharePublicCommand) run(_ *cobra.Command, args []string) {
}
defer conn.Close()
shr, err := client.PublicShare(context.Background(), &agentGrpc.PublicShareRequest{
shr, err := client.SharePublic(context.Background(), &agentGrpc.SharePublicRequest{
Target: target,
BasicAuth: cmd.basicAuth,
FrontendSelection: cmd.frontendSelection,

View File

@ -52,7 +52,7 @@ func (cmd *agentShareReservedCommand) run(_ *cobra.Command, args []string) {
}
defer conn.Close()
shr, err := client.ReservedShare(context.Background(), &agentGrpc.ReservedShareRequest{
shr, err := client.ShareReserved(context.Background(), &agentGrpc.ShareReservedRequest{
Token: args[0],
OverrideEndpoint: cmd.overrideEndpoint,
Insecure: cmd.insecure,