utils

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: AGPL-3.0 Imports: 28 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CmdService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "utils.CmdService",
	HandlerType: (*CmdServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SetLogLevel",
			Handler:    _CmdService_SetLogLevel_Handler,
		},
		{
			MethodName: "PrintLogLevel",
			Handler:    _CmdService_PrintLogLevel_Handler,
		},
		{
			MethodName: "ReloadConf",
			Handler:    _CmdService_ReloadConf_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "cmdService.proto",
}

CmdService_ServiceDesc is the grpc.ServiceDesc for CmdService 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_cmdService_proto protoreflect.FileDescriptor

Functions

func FileExists added in v1.2.0

func FileExists(fileName string) (os.FileInfo, bool)

func GenerateByParam added in v1.2.1

func GenerateByParam(certPath, keyPath string, days int, ecdsaCurve, host string) error

func ReadJsonFile

func ReadJsonFile(path string, v interface{}) error

func RegisterCmdServiceServer added in v1.1.2

func RegisterCmdServiceServer(s grpc.ServiceRegistrar, srv CmdServiceServer)

func StartCmdService added in v1.1.2

func StartCmdService(addr string, ctx context.Context)

func WriteJsonFile added in v1.2.0

func WriteJsonFile(path string, v interface{}) error

Types

type CmdServiceClient added in v1.1.2

type CmdServiceClient interface {
	SetLogLevel(ctx context.Context, in *LogLevel, opts ...grpc.CallOption) (*CommonResponse, error)
	PrintLogLevel(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*CommonResponse, error)
	ReloadConf(ctx context.Context, in *Config, opts ...grpc.CallOption) (*CommonResponse, error)
}

CmdServiceClient is the client API for CmdService 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 DialToCmdService added in v1.1.2

func DialToCmdService(addr string) CmdServiceClient

func NewCmdServiceClient added in v1.1.2

func NewCmdServiceClient(cc grpc.ClientConnInterface) CmdServiceClient

type CmdServiceServer added in v1.1.2

type CmdServiceServer interface {
	SetLogLevel(context.Context, *LogLevel) (*CommonResponse, error)
	PrintLogLevel(context.Context, *EmptyRequest) (*CommonResponse, error)
	ReloadConf(context.Context, *Config) (*CommonResponse, error)
}

CmdServiceServer is the server API for CmdService service. All implementations should embed UnimplementedCmdServiceServer for forward compatibility

type CommonResponse added in v1.1.2

type CommonResponse struct {
	Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"`
	// contains filtered or unexported fields
}

func (*CommonResponse) Descriptor deprecated added in v1.1.2

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

Deprecated: Use CommonResponse.ProtoReflect.Descriptor instead.

func (*CommonResponse) GetMsg added in v1.1.2

func (x *CommonResponse) GetMsg() string

func (*CommonResponse) ProtoMessage added in v1.1.2

func (*CommonResponse) ProtoMessage()

func (*CommonResponse) ProtoReflect added in v1.1.2

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

func (*CommonResponse) Reset added in v1.1.2

func (x *CommonResponse) Reset()

func (*CommonResponse) String added in v1.1.2

func (x *CommonResponse) String() string

type Config added in v1.1.2

type Config struct {
	Show bool   `protobuf:"varint,1,opt,name=show,proto3" json:"show,omitempty"`
	Mode string `protobuf:"bytes,2,opt,name=mode,proto3" json:"mode,omitempty"`
	// contains filtered or unexported fields
}

func (*Config) Descriptor deprecated added in v1.1.2

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

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) GetMode added in v1.1.2

func (x *Config) GetMode() string

func (*Config) GetShow added in v1.1.2

func (x *Config) GetShow() bool

func (*Config) ProtoMessage added in v1.1.2

func (*Config) ProtoMessage()

func (*Config) ProtoReflect added in v1.1.2

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

func (*Config) Reset added in v1.1.2

func (x *Config) Reset()

func (*Config) String added in v1.1.2

func (x *Config) String() string

type EmptyRequest added in v1.1.2

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

func (*EmptyRequest) Descriptor deprecated added in v1.1.2

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

Deprecated: Use EmptyRequest.ProtoReflect.Descriptor instead.

func (*EmptyRequest) ProtoMessage added in v1.1.2

func (*EmptyRequest) ProtoMessage()

func (*EmptyRequest) ProtoReflect added in v1.1.2

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

func (*EmptyRequest) Reset added in v1.1.2

func (x *EmptyRequest) Reset()

func (*EmptyRequest) String added in v1.1.2

func (x *EmptyRequest) String() string

type LogLevel added in v1.1.2

type LogLevel struct {
	Level string `protobuf:"bytes,1,opt,name=Level,proto3" json:"Level,omitempty"`
	// contains filtered or unexported fields
}

func (*LogLevel) Descriptor deprecated added in v1.1.2

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

Deprecated: Use LogLevel.ProtoReflect.Descriptor instead.

func (*LogLevel) GetLevel added in v1.1.2

func (x *LogLevel) GetLevel() string

func (*LogLevel) ProtoMessage added in v1.1.2

func (*LogLevel) ProtoMessage()

func (*LogLevel) ProtoReflect added in v1.1.2

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

func (*LogLevel) Reset added in v1.1.2

func (x *LogLevel) Reset()

func (*LogLevel) String added in v1.1.2

func (x *LogLevel) String() string

type UnimplementedCmdServiceServer added in v1.1.2

type UnimplementedCmdServiceServer struct {
}

UnimplementedCmdServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedCmdServiceServer) PrintLogLevel added in v1.1.2

func (UnimplementedCmdServiceServer) ReloadConf added in v1.1.2

func (UnimplementedCmdServiceServer) SetLogLevel added in v1.1.2

type UnsafeCmdServiceServer added in v1.1.2

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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