Documentation ¶
Index ¶
- Variables
- func CreateServer(p isServerProtocol_Protocol, dialer proxy.Proxy) (server.Server, error)
- func DefaultConfigDir() (Path string)
- func RegisterConfigDaoServer(s grpc.ServiceRegistrar, srv ConfigDaoServer)
- func RegisterProtocol[T isServerProtocol_Protocol](wrap func(T, proxy.Proxy) (server.Server, error))
- type Bypass
- type ConfigDaoClient
- type ConfigDaoServer
- type Dns
- func (*Dns) Descriptor() ([]byte, []int)deprecated
- func (x *Dns) GetHost() string
- func (x *Dns) GetProxy() bool
- func (x *Dns) GetSubnet() string
- func (x *Dns) GetTlsServername() string
- func (x *Dns) GetType() DnsDnsType
- func (*Dns) ProtoMessage()
- func (x *Dns) ProtoReflect() protoreflect.Message
- func (x *Dns) Reset()
- func (x *Dns) String() string
- type DnsDnsType
- type DnsSetting
- func (*DnsSetting) Descriptor() ([]byte, []int)deprecated
- func (x *DnsSetting) GetBootstrap() *Dns
- func (x *DnsSetting) GetLocal() *Dns
- func (x *DnsSetting) GetRemote() *Dns
- func (x *DnsSetting) GetServer() string
- func (*DnsSetting) ProtoMessage()
- func (x *DnsSetting) ProtoReflect() protoreflect.Message
- func (x *DnsSetting) Reset()
- func (x *DnsSetting) String() string
- type Http
- type Redir
- type Server
- type ServerProtocol
- func (*ServerProtocol) Descriptor() ([]byte, []int)deprecated
- func (x *ServerProtocol) GetHttp() *Http
- func (x *ServerProtocol) GetName() string
- func (m *ServerProtocol) GetProtocol() isServerProtocol_Protocol
- func (x *ServerProtocol) GetRedir() *Redir
- func (x *ServerProtocol) GetSocks5() *Socks5
- func (*ServerProtocol) ProtoMessage()
- func (x *ServerProtocol) ProtoReflect() protoreflect.Message
- func (x *ServerProtocol) Reset()
- func (x *ServerProtocol) String() string
- type ServerProtocol_Http
- type ServerProtocol_Redir
- type ServerProtocol_Socks5
- type Setting
- func (*Setting) Descriptor() ([]byte, []int)deprecated
- func (x *Setting) GetBypass() *Bypass
- func (x *Setting) GetDns() *DnsSetting
- func (x *Setting) GetServer() *Server
- func (x *Setting) GetSystemProxy() *SystemProxy
- func (*Setting) ProtoMessage()
- func (x *Setting) ProtoReflect() protoreflect.Message
- func (x *Setting) Reset()
- func (x *Setting) String() string
- type Socks5
- func (*Socks5) Descriptor() ([]byte, []int)deprecated
- func (x *Socks5) GetHost() string
- func (x *Socks5) GetPassword() string
- func (x *Socks5) GetUsername() string
- func (*Socks5) ProtoMessage()
- func (x *Socks5) ProtoReflect() protoreflect.Message
- func (x *Socks5) Reset()
- func (x *Socks5) String() string
- type SystemProxy
- type UnimplementedConfigDaoServer
- type UnsafeConfigDaoServer
Constants ¶
This section is empty.
Variables ¶
var ( DnsDnsType_name = map[int32]string{ 0: "reserve", 1: "udp", 2: "tcp", 3: "doh", 4: "dot", 5: "doq", 6: "doh3", } DnsDnsType_value = map[string]int32{ "reserve": 0, "udp": 1, "tcp": 2, "doh": 3, "dot": 4, "doq": 5, "doh3": 6, } )
Enum value maps for DnsDnsType.
var ConfigDao_ServiceDesc = grpc.ServiceDesc{ ServiceName: "yuhaiin.config.config_dao", HandlerType: (*ConfigDaoServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "load", Handler: _ConfigDao_Load_Handler, }, { MethodName: "save", Handler: _ConfigDao_Save_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "config/config.proto", }
ConfigDao_ServiceDesc is the grpc.ServiceDesc for ConfigDao service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_config_config_proto protoreflect.FileDescriptor
Functions ¶
func CreateServer ¶
func DefaultConfigDir ¶
func DefaultConfigDir() (Path string)
func RegisterConfigDaoServer ¶
func RegisterConfigDaoServer(s grpc.ServiceRegistrar, srv ConfigDaoServer)
Types ¶
type Bypass ¶
type Bypass struct { Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` BypassFile string `protobuf:"bytes,2,opt,name=bypass_file,proto3" json:"bypass_file,omitempty"` // contains filtered or unexported fields }
func (*Bypass) Descriptor
deprecated
func (*Bypass) GetBypassFile ¶
func (*Bypass) GetEnabled ¶
func (*Bypass) ProtoMessage ¶
func (*Bypass) ProtoMessage()
func (*Bypass) ProtoReflect ¶
func (x *Bypass) ProtoReflect() protoreflect.Message
type ConfigDaoClient ¶
type ConfigDaoClient interface { Load(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Setting, error) Save(ctx context.Context, in *Setting, opts ...grpc.CallOption) (*emptypb.Empty, error) }
ConfigDaoClient is the client API for ConfigDao 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 NewConfigDaoClient ¶
func NewConfigDaoClient(cc grpc.ClientConnInterface) ConfigDaoClient
type ConfigDaoServer ¶
type ConfigDaoServer interface { Load(context.Context, *emptypb.Empty) (*Setting, error) Save(context.Context, *Setting) (*emptypb.Empty, error) // contains filtered or unexported methods }
ConfigDaoServer is the server API for ConfigDao service. All implementations must embed UnimplementedConfigDaoServer for forward compatibility
type Dns ¶
type Dns struct { Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` Type DnsDnsType `protobuf:"varint,5,opt,name=type,proto3,enum=yuhaiin.config.DnsDnsType" json:"type,omitempty"` Proxy bool `protobuf:"varint,3,opt,name=proxy,proto3" json:"proxy,omitempty"` Subnet string `protobuf:"bytes,4,opt,name=subnet,proto3" json:"subnet,omitempty"` TlsServername string `protobuf:"bytes,2,opt,name=tls_servername,proto3" json:"tls_servername,omitempty"` // contains filtered or unexported fields }
func (*Dns) Descriptor
deprecated
func (*Dns) GetTlsServername ¶
func (*Dns) GetType ¶
func (x *Dns) GetType() DnsDnsType
func (*Dns) ProtoMessage ¶
func (*Dns) ProtoMessage()
func (*Dns) ProtoReflect ¶
func (x *Dns) ProtoReflect() protoreflect.Message
type DnsDnsType ¶
type DnsDnsType int32
const ( Dns_reserve DnsDnsType = 0 Dns_udp DnsDnsType = 1 Dns_tcp DnsDnsType = 2 Dns_doh DnsDnsType = 3 Dns_dot DnsDnsType = 4 Dns_doq DnsDnsType = 5 Dns_doh3 DnsDnsType = 6 )
func (DnsDnsType) Descriptor ¶
func (DnsDnsType) Descriptor() protoreflect.EnumDescriptor
func (DnsDnsType) Enum ¶
func (x DnsDnsType) Enum() *DnsDnsType
func (DnsDnsType) EnumDescriptor
deprecated
func (DnsDnsType) EnumDescriptor() ([]byte, []int)
Deprecated: Use DnsDnsType.Descriptor instead.
func (DnsDnsType) Number ¶
func (x DnsDnsType) Number() protoreflect.EnumNumber
func (DnsDnsType) String ¶
func (x DnsDnsType) String() string
func (DnsDnsType) Type ¶
func (DnsDnsType) Type() protoreflect.EnumType
type DnsSetting ¶
type DnsSetting struct { Server string `protobuf:"bytes,4,opt,name=server,proto3" json:"server,omitempty"` Remote *Dns `protobuf:"bytes,1,opt,name=remote,proto3" json:"remote,omitempty"` Local *Dns `protobuf:"bytes,2,opt,name=local,proto3" json:"local,omitempty"` Bootstrap *Dns `protobuf:"bytes,3,opt,name=bootstrap,proto3" json:"bootstrap,omitempty"` // contains filtered or unexported fields }
func (*DnsSetting) Descriptor
deprecated
func (*DnsSetting) Descriptor() ([]byte, []int)
Deprecated: Use DnsSetting.ProtoReflect.Descriptor instead.
func (*DnsSetting) GetBootstrap ¶
func (x *DnsSetting) GetBootstrap() *Dns
func (*DnsSetting) GetLocal ¶
func (x *DnsSetting) GetLocal() *Dns
func (*DnsSetting) GetRemote ¶
func (x *DnsSetting) GetRemote() *Dns
func (*DnsSetting) GetServer ¶
func (x *DnsSetting) GetServer() string
func (*DnsSetting) ProtoMessage ¶
func (*DnsSetting) ProtoMessage()
func (*DnsSetting) ProtoReflect ¶
func (x *DnsSetting) ProtoReflect() protoreflect.Message
func (*DnsSetting) Reset ¶
func (x *DnsSetting) Reset()
func (*DnsSetting) String ¶
func (x *DnsSetting) String() string
type Http ¶
type Http struct { Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` // contains filtered or unexported fields }
func (*Http) Descriptor
deprecated
func (*Http) GetPassword ¶
func (*Http) GetUsername ¶
func (*Http) ProtoMessage ¶
func (*Http) ProtoMessage()
func (*Http) ProtoReflect ¶
func (x *Http) ProtoReflect() protoreflect.Message
type Redir ¶
type Redir struct { Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` // contains filtered or unexported fields }
func (*Redir) Descriptor
deprecated
func (*Redir) ProtoMessage ¶
func (*Redir) ProtoMessage()
func (*Redir) ProtoReflect ¶
func (x *Redir) ProtoReflect() protoreflect.Message
type Server ¶
type Server struct { Servers map[string]*ServerProtocol `` /* 155-byte string literal not displayed */ // contains filtered or unexported fields }
func (*Server) Descriptor
deprecated
func (*Server) GetServers ¶
func (x *Server) GetServers() map[string]*ServerProtocol
func (*Server) ProtoMessage ¶
func (*Server) ProtoMessage()
func (*Server) ProtoReflect ¶
func (x *Server) ProtoReflect() protoreflect.Message
type ServerProtocol ¶
type ServerProtocol struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Types that are assignable to Protocol: // *ServerProtocol_Http // *ServerProtocol_Socks5 // *ServerProtocol_Redir Protocol isServerProtocol_Protocol `protobuf_oneof:"protocol"` // contains filtered or unexported fields }
func (*ServerProtocol) Descriptor
deprecated
func (*ServerProtocol) Descriptor() ([]byte, []int)
Deprecated: Use ServerProtocol.ProtoReflect.Descriptor instead.
func (*ServerProtocol) GetHttp ¶
func (x *ServerProtocol) GetHttp() *Http
func (*ServerProtocol) GetName ¶
func (x *ServerProtocol) GetName() string
func (*ServerProtocol) GetProtocol ¶
func (m *ServerProtocol) GetProtocol() isServerProtocol_Protocol
func (*ServerProtocol) GetRedir ¶
func (x *ServerProtocol) GetRedir() *Redir
func (*ServerProtocol) GetSocks5 ¶
func (x *ServerProtocol) GetSocks5() *Socks5
func (*ServerProtocol) ProtoMessage ¶
func (*ServerProtocol) ProtoMessage()
func (*ServerProtocol) ProtoReflect ¶
func (x *ServerProtocol) ProtoReflect() protoreflect.Message
func (*ServerProtocol) Reset ¶
func (x *ServerProtocol) Reset()
func (*ServerProtocol) String ¶
func (x *ServerProtocol) String() string
type ServerProtocol_Http ¶
type ServerProtocol_Http struct {
Http *Http `protobuf:"bytes,3,opt,name=http,proto3,oneof"`
}
type ServerProtocol_Redir ¶
type ServerProtocol_Redir struct {
Redir *Redir `protobuf:"bytes,5,opt,name=redir,proto3,oneof"`
}
type ServerProtocol_Socks5 ¶
type ServerProtocol_Socks5 struct {
Socks5 *Socks5 `protobuf:"bytes,4,opt,name=socks5,proto3,oneof"`
}
type Setting ¶
type Setting struct { SystemProxy *SystemProxy `protobuf:"bytes,1,opt,name=system_proxy,proto3" json:"system_proxy,omitempty"` Bypass *Bypass `protobuf:"bytes,2,opt,name=bypass,proto3" json:"bypass,omitempty"` Dns *DnsSetting `protobuf:"bytes,4,opt,name=dns,proto3" json:"dns,omitempty"` Server *Server `protobuf:"bytes,5,opt,name=server,proto3" json:"server,omitempty"` // contains filtered or unexported fields }
func (*Setting) Descriptor
deprecated
func (*Setting) GetDns ¶
func (x *Setting) GetDns() *DnsSetting
func (*Setting) GetSystemProxy ¶
func (x *Setting) GetSystemProxy() *SystemProxy
func (*Setting) ProtoMessage ¶
func (*Setting) ProtoMessage()
func (*Setting) ProtoReflect ¶
func (x *Setting) ProtoReflect() protoreflect.Message
type Socks5 ¶
type Socks5 struct { Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` // contains filtered or unexported fields }
func (*Socks5) Descriptor
deprecated
func (*Socks5) GetPassword ¶
func (*Socks5) GetUsername ¶
func (*Socks5) ProtoMessage ¶
func (*Socks5) ProtoMessage()
func (*Socks5) ProtoReflect ¶
func (x *Socks5) ProtoReflect() protoreflect.Message
type SystemProxy ¶
type SystemProxy struct { Http bool `protobuf:"varint,2,opt,name=http,proto3" json:"http,omitempty"` Socks5 bool `protobuf:"varint,3,opt,name=socks5,proto3" json:"socks5,omitempty"` // contains filtered or unexported fields }
func (*SystemProxy) Descriptor
deprecated
func (*SystemProxy) Descriptor() ([]byte, []int)
Deprecated: Use SystemProxy.ProtoReflect.Descriptor instead.
func (*SystemProxy) GetHttp ¶
func (x *SystemProxy) GetHttp() bool
func (*SystemProxy) GetSocks5 ¶
func (x *SystemProxy) GetSocks5() bool
func (*SystemProxy) ProtoMessage ¶
func (*SystemProxy) ProtoMessage()
func (*SystemProxy) ProtoReflect ¶
func (x *SystemProxy) ProtoReflect() protoreflect.Message
func (*SystemProxy) Reset ¶
func (x *SystemProxy) Reset()
func (*SystemProxy) String ¶
func (x *SystemProxy) String() string
type UnimplementedConfigDaoServer ¶
type UnimplementedConfigDaoServer struct { }
UnimplementedConfigDaoServer must be embedded to have forward compatible implementations.
type UnsafeConfigDaoServer ¶
type UnsafeConfigDaoServer interface {
// contains filtered or unexported methods
}
UnsafeConfigDaoServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ConfigDaoServer will result in compilation errors.