setting

package
v0.0.0-...-14e102d Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

Package setting is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	SystemService_Info_FullMethodName          = "/api.setting.SystemService/Info"
	SystemService_ResetSetting_FullMethodName  = "/api.setting.SystemService/ResetSetting"
	SystemService_UpdateSetting_FullMethodName = "/api.setting.SystemService/UpdateSetting"
	SystemService_GetSetting_FullMethodName    = "/api.setting.SystemService/GetSetting"
)

Variables

View Source
var File_api_setting_info_proto protoreflect.FileDescriptor
View Source
var File_api_setting_service_proto protoreflect.FileDescriptor
View Source
var File_api_setting_setting_proto protoreflect.FileDescriptor
View Source
var SystemService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.setting.SystemService",
	HandlerType: (*SystemServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Info",
			Handler:    _SystemService_Info_Handler,
		},
		{
			MethodName: "ResetSetting",
			Handler:    _SystemService_ResetSetting_Handler,
		},
		{
			MethodName: "UpdateSetting",
			Handler:    _SystemService_UpdateSetting_Handler,
		},
		{
			MethodName: "GetSetting",
			Handler:    _SystemService_GetSetting_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/setting/service.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 GetSettingRequest

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

func (*GetSettingRequest) Descriptor deprecated

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

Deprecated: Use GetSettingRequest.ProtoReflect.Descriptor instead.

func (*GetSettingRequest) GetKey

func (x *GetSettingRequest) GetKey() string

func (*GetSettingRequest) ProtoMessage

func (*GetSettingRequest) ProtoMessage()

func (*GetSettingRequest) ProtoReflect

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

func (*GetSettingRequest) Reset

func (x *GetSettingRequest) Reset()

func (*GetSettingRequest) String

func (x *GetSettingRequest) String() string

type GetSettingResponse

type GetSettingResponse struct {
	Result *Setting `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*GetSettingResponse) Descriptor deprecated

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

Deprecated: Use GetSettingResponse.ProtoReflect.Descriptor instead.

func (*GetSettingResponse) GetResult

func (x *GetSettingResponse) GetResult() *Setting

func (*GetSettingResponse) ProtoMessage

func (*GetSettingResponse) ProtoMessage()

func (*GetSettingResponse) ProtoReflect

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

func (*GetSettingResponse) Reset

func (x *GetSettingResponse) Reset()

func (*GetSettingResponse) String

func (x *GetSettingResponse) String() string

type Info

type Info struct {
	Os          string `protobuf:"bytes,1,opt,name=os,proto3" json:"os,omitempty"`
	Arch        string `protobuf:"bytes,2,opt,name=arch,proto3" json:"arch,omitempty"`
	Runtime     string `protobuf:"bytes,3,opt,name=runtime,proto3" json:"runtime,omitempty"`
	Version     string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"`
	Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
	// contains filtered or unexported fields
}

func (*Info) Descriptor deprecated

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

Deprecated: Use Info.ProtoReflect.Descriptor instead.

func (*Info) GetArch

func (x *Info) GetArch() string

func (*Info) GetDescription

func (x *Info) GetDescription() string

func (*Info) GetOs

func (x *Info) GetOs() string

func (*Info) GetRuntime

func (x *Info) GetRuntime() string

func (*Info) GetVersion

func (x *Info) GetVersion() string

func (*Info) ProtoMessage

func (*Info) ProtoMessage()

func (*Info) ProtoReflect

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

func (*Info) Reset

func (x *Info) Reset()

func (*Info) String

func (x *Info) String() string

type InfoRequest

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

func (*InfoRequest) Descriptor deprecated

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

Deprecated: Use InfoRequest.ProtoReflect.Descriptor instead.

func (*InfoRequest) ProtoMessage

func (*InfoRequest) ProtoMessage()

func (*InfoRequest) ProtoReflect

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

func (*InfoRequest) Reset

func (x *InfoRequest) Reset()

func (*InfoRequest) String

func (x *InfoRequest) String() string

type InfoResponse

type InfoResponse struct {
	Result *Info `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*InfoResponse) Descriptor deprecated

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

Deprecated: Use InfoResponse.ProtoReflect.Descriptor instead.

func (*InfoResponse) GetResult

func (x *InfoResponse) GetResult() *Info

func (*InfoResponse) ProtoMessage

func (*InfoResponse) ProtoMessage()

func (*InfoResponse) ProtoReflect

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

func (*InfoResponse) Reset

func (x *InfoResponse) Reset()

func (*InfoResponse) String

func (x *InfoResponse) String() string

type ResetSettingRequest

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

func (*ResetSettingRequest) Descriptor deprecated

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

Deprecated: Use ResetSettingRequest.ProtoReflect.Descriptor instead.

func (*ResetSettingRequest) GetKey

func (x *ResetSettingRequest) GetKey() string

func (*ResetSettingRequest) ProtoMessage

func (*ResetSettingRequest) ProtoMessage()

func (*ResetSettingRequest) ProtoReflect

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

func (*ResetSettingRequest) Reset

func (x *ResetSettingRequest) Reset()

func (*ResetSettingRequest) String

func (x *ResetSettingRequest) String() string

type ResetSettingResponse

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

func (*ResetSettingResponse) Descriptor deprecated

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

Deprecated: Use ResetSettingResponse.ProtoReflect.Descriptor instead.

func (*ResetSettingResponse) ProtoMessage

func (*ResetSettingResponse) ProtoMessage()

func (*ResetSettingResponse) ProtoReflect

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

func (*ResetSettingResponse) Reset

func (x *ResetSettingResponse) Reset()

func (*ResetSettingResponse) String

func (x *ResetSettingResponse) String() string

type Setting

type Setting struct {

	// @gotags: gorm:"primary_key;auto_increment"
	Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty" gorm:"primary_key;auto_increment"`
	// @gotags: gorm:"serializer:protobuf_timestamp;type:datetime"
	CreatedAt *timestamppb.Timestamp `` /* 139-byte string literal not displayed */
	// @gotags: gorm:"serializer:protobuf_timestamp;type:datetime"
	UpdatedAt *timestamppb.Timestamp `` /* 139-byte string literal not displayed */
	// @gotags: gorm:"size:128;not null;unique"
	Key   string `protobuf:"bytes,4,opt,name=key,proto3" json:"key,omitempty" gorm:"size:128;not null;unique"`
	Value string `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*Setting) Descriptor deprecated

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

Deprecated: Use Setting.ProtoReflect.Descriptor instead.

func (*Setting) GetCreatedAt

func (x *Setting) GetCreatedAt() *timestamppb.Timestamp

func (*Setting) GetId

func (x *Setting) GetId() int32

func (*Setting) GetKey

func (x *Setting) GetKey() string

func (*Setting) GetUpdatedAt

func (x *Setting) GetUpdatedAt() *timestamppb.Timestamp

func (*Setting) GetValue

func (x *Setting) GetValue() string

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 SystemServiceClient

type SystemServiceClient interface {
	Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error)
	ResetSetting(ctx context.Context, in *ResetSettingRequest, opts ...grpc.CallOption) (*ResetSettingResponse, error)
	UpdateSetting(ctx context.Context, in *UpdateSettingRequest, opts ...grpc.CallOption) (*UpdateSettingResponse, error)
	GetSetting(ctx context.Context, in *GetSettingRequest, opts ...grpc.CallOption) (*GetSettingResponse, 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 {
	Info(context.Context, *InfoRequest) (*InfoResponse, error)
	ResetSetting(context.Context, *ResetSettingRequest) (*ResetSettingResponse, error)
	UpdateSetting(context.Context, *UpdateSettingRequest) (*UpdateSettingResponse, error)
	GetSetting(context.Context, *GetSettingRequest) (*GetSettingResponse, 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) GetSetting

func (UnimplementedSystemServiceServer) Info

func (UnimplementedSystemServiceServer) ResetSetting

func (UnimplementedSystemServiceServer) UpdateSetting

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.

type UpdateSettingRequest

type UpdateSettingRequest struct {
	Key   string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateSettingRequest) Descriptor deprecated

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

Deprecated: Use UpdateSettingRequest.ProtoReflect.Descriptor instead.

func (*UpdateSettingRequest) GetKey

func (x *UpdateSettingRequest) GetKey() string

func (*UpdateSettingRequest) GetValue

func (x *UpdateSettingRequest) GetValue() string

func (*UpdateSettingRequest) ProtoMessage

func (*UpdateSettingRequest) ProtoMessage()

func (*UpdateSettingRequest) ProtoReflect

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

func (*UpdateSettingRequest) Reset

func (x *UpdateSettingRequest) Reset()

func (*UpdateSettingRequest) String

func (x *UpdateSettingRequest) String() string

type UpdateSettingResponse

type UpdateSettingResponse struct {
	Result *Setting `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateSettingResponse) Descriptor deprecated

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

Deprecated: Use UpdateSettingResponse.ProtoReflect.Descriptor instead.

func (*UpdateSettingResponse) GetResult

func (x *UpdateSettingResponse) GetResult() *Setting

func (*UpdateSettingResponse) ProtoMessage

func (*UpdateSettingResponse) ProtoMessage()

func (*UpdateSettingResponse) ProtoReflect

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

func (*UpdateSettingResponse) Reset

func (x *UpdateSettingResponse) Reset()

func (*UpdateSettingResponse) String

func (x *UpdateSettingResponse) String() string

Jump to

Keyboard shortcuts

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