config

package
v0.3.1-beta.3 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
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)

View Source
var File_config_config_proto protoreflect.FileDescriptor

Functions

func CreateServer

func CreateServer(p isServerProtocol_Protocol, dialer proxy.Proxy) (server.Server, error)

func DefaultConfigDir

func DefaultConfigDir() (Path string)

func RegisterConfigDaoServer

func RegisterConfigDaoServer(s grpc.ServiceRegistrar, srv ConfigDaoServer)

func RegisterProtocol

func RegisterProtocol[T isServerProtocol_Protocol](wrap func(T, proxy.Proxy) (server.Server, error))

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) Descriptor() ([]byte, []int)

Deprecated: Use Bypass.ProtoReflect.Descriptor instead.

func (*Bypass) GetBypassFile

func (x *Bypass) GetBypassFile() string

func (*Bypass) GetEnabled

func (x *Bypass) GetEnabled() bool

func (*Bypass) ProtoMessage

func (*Bypass) ProtoMessage()

func (*Bypass) ProtoReflect

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

func (*Bypass) Reset

func (x *Bypass) Reset()

func (*Bypass) String

func (x *Bypass) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Dns.ProtoReflect.Descriptor instead.

func (*Dns) GetHost

func (x *Dns) GetHost() string

func (*Dns) GetProxy

func (x *Dns) GetProxy() bool

func (*Dns) GetSubnet

func (x *Dns) GetSubnet() string

func (*Dns) GetTlsServername

func (x *Dns) GetTlsServername() string

func (*Dns) GetType

func (x *Dns) GetType() DnsDnsType

func (*Dns) ProtoMessage

func (*Dns) ProtoMessage()

func (*Dns) ProtoReflect

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

func (*Dns) Reset

func (x *Dns) Reset()

func (*Dns) String

func (x *Dns) String() string

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

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) Descriptor() ([]byte, []int)

Deprecated: Use Http.ProtoReflect.Descriptor instead.

func (*Http) GetHost

func (x *Http) GetHost() string

func (*Http) GetPassword

func (x *Http) GetPassword() string

func (*Http) GetUsername

func (x *Http) GetUsername() string

func (*Http) ProtoMessage

func (*Http) ProtoMessage()

func (*Http) ProtoReflect

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

func (*Http) Reset

func (x *Http) Reset()

func (*Http) String

func (x *Http) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Redir.ProtoReflect.Descriptor instead.

func (*Redir) GetHost

func (x *Redir) GetHost() string

func (*Redir) ProtoMessage

func (*Redir) ProtoMessage()

func (*Redir) ProtoReflect

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

func (*Redir) Reset

func (x *Redir) Reset()

func (*Redir) String

func (x *Redir) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Server.ProtoReflect.Descriptor instead.

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

func (*Server) Reset

func (x *Server) Reset()

func (*Server) String

func (x *Server) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Setting.ProtoReflect.Descriptor instead.

func (*Setting) GetBypass

func (x *Setting) GetBypass() *Bypass

func (*Setting) GetDns

func (x *Setting) GetDns() *DnsSetting

func (*Setting) GetServer

func (x *Setting) GetServer() *Server

func (*Setting) GetSystemProxy

func (x *Setting) GetSystemProxy() *SystemProxy

func (*Setting) ProtoMessage

func (*Setting) ProtoMessage()

func (*Setting) ProtoReflect

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

func (*Setting) Reset

func (x *Setting) Reset()

func (*Setting) String

func (x *Setting) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Socks5.ProtoReflect.Descriptor instead.

func (*Socks5) GetHost

func (x *Socks5) GetHost() string

func (*Socks5) GetPassword

func (x *Socks5) GetPassword() string

func (*Socks5) GetUsername

func (x *Socks5) GetUsername() string

func (*Socks5) ProtoMessage

func (*Socks5) ProtoMessage()

func (*Socks5) ProtoReflect

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

func (*Socks5) Reset

func (x *Socks5) Reset()

func (*Socks5) String

func (x *Socks5) String() string

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.

func (UnimplementedConfigDaoServer) Load

func (UnimplementedConfigDaoServer) Save

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.

Jump to

Keyboard shortcuts

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