| // Code generated by protoc-gen-go. DO NOT EDIT. |
| // source: proxy_service.proto |
| |
| package network |
| |
| import ( |
| context "context" |
| fmt "fmt" |
| proto "github.com/golang/protobuf/proto" |
| empty "github.com/golang/protobuf/ptypes/empty" |
| grpc "google.golang.org/grpc" |
| codes "google.golang.org/grpc/codes" |
| status "google.golang.org/grpc/status" |
| math "math" |
| ) |
| |
| // Reference imports to suppress errors if they are not otherwise used. |
| var _ = proto.Marshal |
| var _ = fmt.Errorf |
| var _ = math.Inf |
| |
| // This is a compile-time assertion to ensure that this generated file |
| // is compatible with the proto package it is being compiled against. |
| // A compilation error at this line likely means your copy of the |
| // proto package needs to be updated. |
| const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package |
| |
| type AuthCredentials struct { |
| Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` |
| Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` |
| XXX_NoUnkeyedLiteral struct{} `json:"-"` |
| XXX_unrecognized []byte `json:"-"` |
| XXX_sizecache int32 `json:"-"` |
| } |
| |
| func (m *AuthCredentials) Reset() { *m = AuthCredentials{} } |
| func (m *AuthCredentials) String() string { return proto.CompactTextString(m) } |
| func (*AuthCredentials) ProtoMessage() {} |
| func (*AuthCredentials) Descriptor() ([]byte, []int) { |
| return fileDescriptor_34ca2fbc94d169de, []int{0} |
| } |
| |
| func (m *AuthCredentials) XXX_Unmarshal(b []byte) error { |
| return xxx_messageInfo_AuthCredentials.Unmarshal(m, b) |
| } |
| func (m *AuthCredentials) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { |
| return xxx_messageInfo_AuthCredentials.Marshal(b, m, deterministic) |
| } |
| func (m *AuthCredentials) XXX_Merge(src proto.Message) { |
| xxx_messageInfo_AuthCredentials.Merge(m, src) |
| } |
| func (m *AuthCredentials) XXX_Size() int { |
| return xxx_messageInfo_AuthCredentials.Size(m) |
| } |
| func (m *AuthCredentials) XXX_DiscardUnknown() { |
| xxx_messageInfo_AuthCredentials.DiscardUnknown(m) |
| } |
| |
| var xxx_messageInfo_AuthCredentials proto.InternalMessageInfo |
| |
| func (m *AuthCredentials) GetUsername() string { |
| if m != nil { |
| return m.Username |
| } |
| return "" |
| } |
| |
| func (m *AuthCredentials) GetPassword() string { |
| if m != nil { |
| return m.Password |
| } |
| return "" |
| } |
| |
| type StartServerRequest struct { |
| // Optional. Port where the proxy should listen for incoming connections. Must |
| // be a valid port value (1 to 65535). If not set, the default value is 3128. |
| Port uint32 `protobuf:"varint,1,opt,name=port,proto3" json:"port,omitempty"` |
| // Credentials for basic authentication. If set, clients connecting to the |
| // proxy server must provide the same credentials for authentication otherwise |
| // the connection will fail. Leave unset if the proxy should not require |
| // authentication. |
| AuthCredentials *AuthCredentials `protobuf:"bytes,2,opt,name=auth_credentials,json=authCredentials,proto3" json:"auth_credentials,omitempty"` |
| // Specifies the hostnames to which connections are allowed through the proxy. |
| // Regex expressions and IP addresses are allowed. |
| Allowlist []string `protobuf:"bytes,3,rep,name=allowlist,proto3" json:"allowlist,omitempty"` |
| XXX_NoUnkeyedLiteral struct{} `json:"-"` |
| XXX_unrecognized []byte `json:"-"` |
| XXX_sizecache int32 `json:"-"` |
| } |
| |
| func (m *StartServerRequest) Reset() { *m = StartServerRequest{} } |
| func (m *StartServerRequest) String() string { return proto.CompactTextString(m) } |
| func (*StartServerRequest) ProtoMessage() {} |
| func (*StartServerRequest) Descriptor() ([]byte, []int) { |
| return fileDescriptor_34ca2fbc94d169de, []int{1} |
| } |
| |
| func (m *StartServerRequest) XXX_Unmarshal(b []byte) error { |
| return xxx_messageInfo_StartServerRequest.Unmarshal(m, b) |
| } |
| func (m *StartServerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { |
| return xxx_messageInfo_StartServerRequest.Marshal(b, m, deterministic) |
| } |
| func (m *StartServerRequest) XXX_Merge(src proto.Message) { |
| xxx_messageInfo_StartServerRequest.Merge(m, src) |
| } |
| func (m *StartServerRequest) XXX_Size() int { |
| return xxx_messageInfo_StartServerRequest.Size(m) |
| } |
| func (m *StartServerRequest) XXX_DiscardUnknown() { |
| xxx_messageInfo_StartServerRequest.DiscardUnknown(m) |
| } |
| |
| var xxx_messageInfo_StartServerRequest proto.InternalMessageInfo |
| |
| func (m *StartServerRequest) GetPort() uint32 { |
| if m != nil { |
| return m.Port |
| } |
| return 0 |
| } |
| |
| func (m *StartServerRequest) GetAuthCredentials() *AuthCredentials { |
| if m != nil { |
| return m.AuthCredentials |
| } |
| return nil |
| } |
| |
| func (m *StartServerRequest) GetAllowlist() []string { |
| if m != nil { |
| return m.Allowlist |
| } |
| return nil |
| } |
| |
| type StartServerResponse struct { |
| // The host and port where the proxy is listening for connections, in the |
| // format <host>:<port>. Clients should use this value to point to the proxy |
| // server. NOTE: This is an HTTP proxy. |
| HostAndPort string `protobuf:"bytes,1,opt,name=host_and_port,json=hostAndPort,proto3" json:"host_and_port,omitempty"` |
| XXX_NoUnkeyedLiteral struct{} `json:"-"` |
| XXX_unrecognized []byte `json:"-"` |
| XXX_sizecache int32 `json:"-"` |
| } |
| |
| func (m *StartServerResponse) Reset() { *m = StartServerResponse{} } |
| func (m *StartServerResponse) String() string { return proto.CompactTextString(m) } |
| func (*StartServerResponse) ProtoMessage() {} |
| func (*StartServerResponse) Descriptor() ([]byte, []int) { |
| return fileDescriptor_34ca2fbc94d169de, []int{2} |
| } |
| |
| func (m *StartServerResponse) XXX_Unmarshal(b []byte) error { |
| return xxx_messageInfo_StartServerResponse.Unmarshal(m, b) |
| } |
| func (m *StartServerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { |
| return xxx_messageInfo_StartServerResponse.Marshal(b, m, deterministic) |
| } |
| func (m *StartServerResponse) XXX_Merge(src proto.Message) { |
| xxx_messageInfo_StartServerResponse.Merge(m, src) |
| } |
| func (m *StartServerResponse) XXX_Size() int { |
| return xxx_messageInfo_StartServerResponse.Size(m) |
| } |
| func (m *StartServerResponse) XXX_DiscardUnknown() { |
| xxx_messageInfo_StartServerResponse.DiscardUnknown(m) |
| } |
| |
| var xxx_messageInfo_StartServerResponse proto.InternalMessageInfo |
| |
| func (m *StartServerResponse) GetHostAndPort() string { |
| if m != nil { |
| return m.HostAndPort |
| } |
| return "" |
| } |
| |
| func init() { |
| proto.RegisterType((*AuthCredentials)(nil), "tast.cros.network.AuthCredentials") |
| proto.RegisterType((*StartServerRequest)(nil), "tast.cros.network.StartServerRequest") |
| proto.RegisterType((*StartServerResponse)(nil), "tast.cros.network.StartServerResponse") |
| } |
| |
| func init() { proto.RegisterFile("proxy_service.proto", fileDescriptor_34ca2fbc94d169de) } |
| |
| var fileDescriptor_34ca2fbc94d169de = []byte{ |
| // 345 bytes of a gzipped FileDescriptorProto |
| 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xcd, 0x4a, 0xeb, 0x40, |
| 0x14, 0xc7, 0x9b, 0xdb, 0xcb, 0xe5, 0x66, 0x6a, 0xa9, 0x4e, 0x41, 0x4a, 0x74, 0x51, 0x02, 0xd5, |
| 0xae, 0x26, 0x50, 0x57, 0x6e, 0x84, 0x2a, 0x2e, 0x5c, 0x08, 0x25, 0xd9, 0xb9, 0x30, 0x4c, 0x93, |
| 0xb1, 0x09, 0x26, 0x39, 0x71, 0xce, 0x49, 0x6b, 0x1f, 0xc4, 0xd7, 0xf0, 0x19, 0x25, 0x49, 0x3f, |
| 0xb4, 0x55, 0xdc, 0xcd, 0xf9, 0x98, 0xff, 0xff, 0x37, 0xe7, 0x0c, 0xeb, 0xe6, 0x1a, 0x5e, 0x97, |
| 0x3e, 0x2a, 0x3d, 0x8f, 0x03, 0x25, 0x72, 0x0d, 0x04, 0xfc, 0x88, 0x24, 0x92, 0x08, 0x34, 0xa0, |
| 0xc8, 0x14, 0x2d, 0x40, 0x3f, 0x5b, 0x27, 0x33, 0x80, 0x59, 0xa2, 0x9c, 0xaa, 0x61, 0x5a, 0x3c, |
| 0x39, 0x2a, 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, 0xf5, 0xea, 0xc4, 0x6d, 0xb9, 0x3a, 0xeb, 0x87, 0xbc, 0xdd, |
| 0xb8, 0x3e, 0x7f, 0x18, 0x04, 0x91, 0x86, 0x34, 0x2e, 0x52, 0x40, 0xa7, 0x74, 0x75, 0x56, 0xff, |
| 0x03, 0x9d, 0xd2, 0xde, 0x59, 0xd9, 0x4f, 0xff, 0x55, 0x57, 0x2f, 0x3e, 0x02, 0x00, 0x00, 0xff, |
| 0xff, 0x4d, 0xd6, 0x63, 0x61, 0x45, 0x02, 0x00, 0x00, |
| } |
| |
| // Reference imports to suppress errors if they are not otherwise used. |
| var _ context.Context |
| var _ grpc.ClientConn |
| |
| // This is a compile-time assertion to ensure that this generated file |
| // is compatible with the grpc package it is being compiled against. |
| const _ = grpc.SupportPackageIsVersion4 |
| |
| // ProxyServiceClient is the client API for ProxyService service. |
| // |
| // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. |
| type ProxyServiceClient interface { |
| // StartServer starts a proxy server instance with the given configuration. |
| StartServer(ctx context.Context, in *StartServerRequest, opts ...grpc.CallOption) (*StartServerResponse, error) |
| // StopServer stops the running server instance. |
| StopServer(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error) |
| } |
| |
| type proxyServiceClient struct { |
| cc *grpc.ClientConn |
| } |
| |
| func NewProxyServiceClient(cc *grpc.ClientConn) ProxyServiceClient { |
| return &proxyServiceClient{cc} |
| } |
| |
| func (c *proxyServiceClient) StartServer(ctx context.Context, in *StartServerRequest, opts ...grpc.CallOption) (*StartServerResponse, error) { |
| out := new(StartServerResponse) |
| err := c.cc.Invoke(ctx, "/tast.cros.network.ProxyService/StartServer", in, out, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return out, nil |
| } |
| |
| func (c *proxyServiceClient) StopServer(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error) { |
| out := new(empty.Empty) |
| err := c.cc.Invoke(ctx, "/tast.cros.network.ProxyService/StopServer", in, out, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return out, nil |
| } |
| |
| // ProxyServiceServer is the server API for ProxyService service. |
| type ProxyServiceServer interface { |
| // StartServer starts a proxy server instance with the given configuration. |
| StartServer(context.Context, *StartServerRequest) (*StartServerResponse, error) |
| // StopServer stops the running server instance. |
| StopServer(context.Context, *empty.Empty) (*empty.Empty, error) |
| } |
| |
| // UnimplementedProxyServiceServer can be embedded to have forward compatible implementations. |
| type UnimplementedProxyServiceServer struct { |
| } |
| |
| func (*UnimplementedProxyServiceServer) StartServer(ctx context.Context, req *StartServerRequest) (*StartServerResponse, error) { |
| return nil, status.Errorf(codes.Unimplemented, "method StartServer not implemented") |
| } |
| func (*UnimplementedProxyServiceServer) StopServer(ctx context.Context, req *empty.Empty) (*empty.Empty, error) { |
| return nil, status.Errorf(codes.Unimplemented, "method StopServer not implemented") |
| } |
| |
| func RegisterProxyServiceServer(s *grpc.Server, srv ProxyServiceServer) { |
| s.RegisterService(&_ProxyService_serviceDesc, srv) |
| } |
| |
| func _ProxyService_StartServer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| in := new(StartServerRequest) |
| if err := dec(in); err != nil { |
| return nil, err |
| } |
| if interceptor == nil { |
| return srv.(ProxyServiceServer).StartServer(ctx, in) |
| } |
| info := &grpc.UnaryServerInfo{ |
| Server: srv, |
| FullMethod: "/tast.cros.network.ProxyService/StartServer", |
| } |
| handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| return srv.(ProxyServiceServer).StartServer(ctx, req.(*StartServerRequest)) |
| } |
| return interceptor(ctx, in, info, handler) |
| } |
| |
| func _ProxyService_StopServer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| in := new(empty.Empty) |
| if err := dec(in); err != nil { |
| return nil, err |
| } |
| if interceptor == nil { |
| return srv.(ProxyServiceServer).StopServer(ctx, in) |
| } |
| info := &grpc.UnaryServerInfo{ |
| Server: srv, |
| FullMethod: "/tast.cros.network.ProxyService/StopServer", |
| } |
| handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| return srv.(ProxyServiceServer).StopServer(ctx, req.(*empty.Empty)) |
| } |
| return interceptor(ctx, in, info, handler) |
| } |
| |
| var _ProxyService_serviceDesc = grpc.ServiceDesc{ |
| ServiceName: "tast.cros.network.ProxyService", |
| HandlerType: (*ProxyServiceServer)(nil), |
| Methods: []grpc.MethodDesc{ |
| { |
| MethodName: "StartServer", |
| Handler: _ProxyService_StartServer_Handler, |
| }, |
| { |
| MethodName: "StopServer", |
| Handler: _ProxyService_StopServer_Handler, |
| }, |
| }, |
| Streams: []grpc.StreamDesc{}, |
| Metadata: "proxy_service.proto", |
| } |