systemV1

package
v0.0.0-...-34841a2 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package systemV1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	SystemService_GetSettings_FullMethodName = "/system.v1.SystemService/GetSettings"
	SystemService_SetSettings_FullMethodName = "/system.v1.SystemService/SetSettings"
)

Variables

View Source
var File_system_v1_system_proto protoreflect.FileDescriptor
View Source
var SystemService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "system.v1.SystemService",
	HandlerType: (*SystemServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetSettings",
			Handler:    _SystemService_GetSettings_Handler,
		},
		{
			MethodName: "SetSettings",
			Handler:    _SystemService_SetSettings_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "system/v1/system.proto",
}

SystemService_ServiceDesc is the grpc.ServiceDesc for SystemService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterSystemServiceHandler

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

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

func RegisterSystemServiceHandlerClient

func RegisterSystemServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SystemServiceClient) error

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

func RegisterSystemServiceHandlerFromEndpoint

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

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

func RegisterSystemServiceHandlerServer

func RegisterSystemServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SystemServiceServer) error

RegisterSystemServiceHandlerServer registers the http handlers for service SystemService to "mux". UnaryRPC :call SystemServiceServer 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 RegisterSystemServiceHandlerFromEndpoint instead. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.

func RegisterSystemServiceServer

func RegisterSystemServiceServer(s grpc.ServiceRegistrar, srv SystemServiceServer)

Types

type GetSettingsRequest

type GetSettingsRequest struct {
	// contains filtered or unexported fields
}

func (*GetSettingsRequest) Descriptor deprecated

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

Deprecated: Use GetSettingsRequest.ProtoReflect.Descriptor instead.

func (*GetSettingsRequest) ProtoMessage

func (*GetSettingsRequest) ProtoMessage()

func (*GetSettingsRequest) ProtoReflect

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

func (*GetSettingsRequest) Reset

func (x *GetSettingsRequest) Reset()

func (*GetSettingsRequest) String

func (x *GetSettingsRequest) String() string

type GetSettingsResponse

type GetSettingsResponse struct {
	Settings *Settings `protobuf:"bytes,1,opt,name=settings,proto3" json:"settings,omitempty"`
	// contains filtered or unexported fields
}

func (*GetSettingsResponse) Descriptor deprecated

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

Deprecated: Use GetSettingsResponse.ProtoReflect.Descriptor instead.

func (*GetSettingsResponse) GetSettings

func (x *GetSettingsResponse) GetSettings() *Settings

func (*GetSettingsResponse) ProtoMessage

func (*GetSettingsResponse) ProtoMessage()

func (*GetSettingsResponse) ProtoReflect

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

func (*GetSettingsResponse) Reset

func (x *GetSettingsResponse) Reset()

func (*GetSettingsResponse) String

func (x *GetSettingsResponse) String() string

type InnetTracker

type InnetTracker struct {
	Id          string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Addr        string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"`
	Enable      bool   `protobuf:"varint,3,opt,name=enable,proto3" json:"enable,omitempty"`
	ToBeDeleted bool   `protobuf:"varint,4,opt,name=toBeDeleted,proto3" json:"toBeDeleted,omitempty"`
	// contains filtered or unexported fields
}

func (*InnetTracker) Descriptor deprecated

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

Deprecated: Use InnetTracker.ProtoReflect.Descriptor instead.

func (*InnetTracker) GetAddr

func (x *InnetTracker) GetAddr() string

func (*InnetTracker) GetEnable

func (x *InnetTracker) GetEnable() bool

func (*InnetTracker) GetId

func (x *InnetTracker) GetId() string

func (*InnetTracker) GetToBeDeleted

func (x *InnetTracker) GetToBeDeleted() bool

func (*InnetTracker) ProtoMessage

func (*InnetTracker) ProtoMessage()

func (*InnetTracker) ProtoReflect

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

func (*InnetTracker) Reset

func (x *InnetTracker) Reset()

func (*InnetTracker) String

func (x *InnetTracker) String() string

type SetSettingsRequest

type SetSettingsRequest struct {
	Settings *Settings `protobuf:"bytes,1,opt,name=settings,proto3" json:"settings,omitempty"`
	// contains filtered or unexported fields
}

func (*SetSettingsRequest) Descriptor deprecated

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

Deprecated: Use SetSettingsRequest.ProtoReflect.Descriptor instead.

func (*SetSettingsRequest) GetSettings

func (x *SetSettingsRequest) GetSettings() *Settings

func (*SetSettingsRequest) ProtoMessage

func (*SetSettingsRequest) ProtoMessage()

func (*SetSettingsRequest) ProtoReflect

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

func (*SetSettingsRequest) Reset

func (x *SetSettingsRequest) Reset()

func (*SetSettingsRequest) String

func (x *SetSettingsRequest) String() string

type SetSettingsResponse

type SetSettingsResponse struct {
	// contains filtered or unexported fields
}

func (*SetSettingsResponse) Descriptor deprecated

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

Deprecated: Use SetSettingsResponse.ProtoReflect.Descriptor instead.

func (*SetSettingsResponse) ProtoMessage

func (*SetSettingsResponse) ProtoMessage()

func (*SetSettingsResponse) ProtoReflect

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

func (*SetSettingsResponse) Reset

func (x *SetSettingsResponse) Reset()

func (*SetSettingsResponse) String

func (x *SetSettingsResponse) String() string

type Settings

type Settings struct {
	PeerExpireTime int32           `protobuf:"varint,1,opt,name=peerExpireTime,proto3" json:"peerExpireTime,omitempty"`
	AllowedNets    []string        `protobuf:"bytes,2,rep,name=allowedNets,proto3" json:"allowedNets,omitempty"`
	SmtpEnable     bool            `protobuf:"varint,3,opt,name=smtpEnable,proto3" json:"smtpEnable,omitempty"`
	SmtpHost       string          `protobuf:"bytes,4,opt,name=smtpHost,proto3" json:"smtpHost,omitempty"`
	SmtpPort       int32           `protobuf:"varint,5,opt,name=smtpPort,proto3" json:"smtpPort,omitempty"`
	SmtpUser       string          `protobuf:"bytes,6,opt,name=smtpUser,proto3" json:"smtpUser,omitempty"`
	SmtpPassword   string          `protobuf:"bytes,7,opt,name=smtpPassword,proto3" json:"smtpPassword,omitempty"`
	RegisterEnable bool            `protobuf:"varint,8,opt,name=registerEnable,proto3" json:"registerEnable,omitempty"`
	LoginEnable    bool            `protobuf:"varint,9,opt,name=loginEnable,proto3" json:"loginEnable,omitempty"`
	PublishEnable  bool            `protobuf:"varint,10,opt,name=publishEnable,proto3" json:"publishEnable,omitempty"`
	InnetTracker   []*InnetTracker `protobuf:"bytes,11,rep,name=innetTracker,proto3" json:"innetTracker,omitempty"`
	// contains filtered or unexported fields
}

func (*Settings) Descriptor deprecated

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

Deprecated: Use Settings.ProtoReflect.Descriptor instead.

func (*Settings) GetAllowedNets

func (x *Settings) GetAllowedNets() []string

func (*Settings) GetInnetTracker

func (x *Settings) GetInnetTracker() []*InnetTracker

func (*Settings) GetLoginEnable

func (x *Settings) GetLoginEnable() bool

func (*Settings) GetPeerExpireTime

func (x *Settings) GetPeerExpireTime() int32

func (*Settings) GetPublishEnable

func (x *Settings) GetPublishEnable() bool

func (*Settings) GetRegisterEnable

func (x *Settings) GetRegisterEnable() bool

func (*Settings) GetSmtpEnable

func (x *Settings) GetSmtpEnable() bool

func (*Settings) GetSmtpHost

func (x *Settings) GetSmtpHost() string

func (*Settings) GetSmtpPassword

func (x *Settings) GetSmtpPassword() string

func (*Settings) GetSmtpPort

func (x *Settings) GetSmtpPort() int32

func (*Settings) GetSmtpUser

func (x *Settings) GetSmtpUser() string

func (*Settings) ProtoMessage

func (*Settings) ProtoMessage()

func (*Settings) ProtoReflect

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

func (*Settings) Reset

func (x *Settings) Reset()

func (*Settings) String

func (x *Settings) String() string

type SystemServiceClient

type SystemServiceClient interface {
	GetSettings(ctx context.Context, in *GetSettingsRequest, opts ...grpc.CallOption) (*GetSettingsResponse, error)
	SetSettings(ctx context.Context, in *SetSettingsRequest, opts ...grpc.CallOption) (*SetSettingsResponse, error)
}

SystemServiceClient is the client API for SystemService 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.

type SystemServiceServer

type SystemServiceServer interface {
	GetSettings(context.Context, *GetSettingsRequest) (*GetSettingsResponse, error)
	SetSettings(context.Context, *SetSettingsRequest) (*SetSettingsResponse, error)
	// contains filtered or unexported methods
}

SystemServiceServer is the server API for SystemService service. All implementations must embed UnimplementedSystemServiceServer for forward compatibility.

type UnimplementedSystemServiceServer

type UnimplementedSystemServiceServer struct{}

UnimplementedSystemServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedSystemServiceServer) GetSettings

func (UnimplementedSystemServiceServer) SetSettings

type UnsafeSystemServiceServer

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

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

Jump to

Keyboard shortcuts

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