Documentation
¶
Overview ¶
Package setting is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterSystemServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterSystemServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SystemServiceClient) error
- func RegisterSystemServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterSystemServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SystemServiceServer) error
- func RegisterSystemServiceServer(s grpc.ServiceRegistrar, srv SystemServiceServer)
- type GetSettingRequest
- type GetSettingResponse
- func (*GetSettingResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetSettingResponse) GetResult() *Setting
- func (*GetSettingResponse) ProtoMessage()
- func (x *GetSettingResponse) ProtoReflect() protoreflect.Message
- func (x *GetSettingResponse) Reset()
- func (x *GetSettingResponse) String() string
- type Info
- func (*Info) Descriptor() ([]byte, []int)deprecated
- func (x *Info) GetArch() string
- func (x *Info) GetDescription() string
- func (x *Info) GetOs() string
- func (x *Info) GetRuntime() string
- func (x *Info) GetVersion() string
- func (*Info) ProtoMessage()
- func (x *Info) ProtoReflect() protoreflect.Message
- func (x *Info) Reset()
- func (x *Info) String() string
- type InfoRequest
- type InfoResponse
- type ResetSettingRequest
- func (*ResetSettingRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ResetSettingRequest) GetKey() string
- func (*ResetSettingRequest) ProtoMessage()
- func (x *ResetSettingRequest) ProtoReflect() protoreflect.Message
- func (x *ResetSettingRequest) Reset()
- func (x *ResetSettingRequest) String() string
- type ResetSettingResponse
- type Setting
- func (*Setting) Descriptor() ([]byte, []int)deprecated
- func (x *Setting) GetCreatedAt() *timestamppb.Timestamp
- func (x *Setting) GetId() int32
- func (x *Setting) GetKey() string
- func (x *Setting) GetUpdatedAt() *timestamppb.Timestamp
- func (x *Setting) GetValue() string
- func (*Setting) ProtoMessage()
- func (x *Setting) ProtoReflect() protoreflect.Message
- func (x *Setting) Reset()
- func (x *Setting) String() string
- type SystemServiceClient
- type SystemServiceServer
- type UnimplementedSystemServiceServer
- func (UnimplementedSystemServiceServer) GetSetting(context.Context, *GetSettingRequest) (*GetSettingResponse, error)
- func (UnimplementedSystemServiceServer) Info(context.Context, *InfoRequest) (*InfoResponse, error)
- func (UnimplementedSystemServiceServer) ResetSetting(context.Context, *ResetSettingRequest) (*ResetSettingResponse, error)
- func (UnimplementedSystemServiceServer) UpdateSetting(context.Context, *UpdateSettingRequest) (*UpdateSettingResponse, error)
- type UnsafeSystemServiceServer
- type UpdateSettingRequest
- func (*UpdateSettingRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateSettingRequest) GetKey() string
- func (x *UpdateSettingRequest) GetValue() string
- func (*UpdateSettingRequest) ProtoMessage()
- func (x *UpdateSettingRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateSettingRequest) Reset()
- func (x *UpdateSettingRequest) String() string
- type UpdateSettingResponse
- func (*UpdateSettingResponse) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateSettingResponse) GetResult() *Setting
- func (*UpdateSettingResponse) ProtoMessage()
- func (x *UpdateSettingResponse) ProtoReflect() protoreflect.Message
- func (x *UpdateSettingResponse) Reset()
- func (x *UpdateSettingResponse) String() string
Constants ¶
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 ¶
var File_api_setting_info_proto protoreflect.FileDescriptor
var File_api_setting_service_proto protoreflect.FileDescriptor
var File_api_setting_setting_proto protoreflect.FileDescriptor
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) GetDescription ¶
func (*Info) GetRuntime ¶
func (*Info) GetVersion ¶
func (*Info) ProtoMessage ¶
func (*Info) ProtoMessage()
func (*Info) ProtoReflect ¶
func (x *Info) ProtoReflect() protoreflect.Message
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) GetCreatedAt ¶
func (x *Setting) GetCreatedAt() *timestamppb.Timestamp
func (*Setting) GetUpdatedAt ¶
func (x *Setting) GetUpdatedAt() *timestamppb.Timestamp
func (*Setting) ProtoMessage ¶
func (*Setting) ProtoMessage()
func (*Setting) ProtoReflect ¶
func (x *Setting) ProtoReflect() protoreflect.Message
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.
func NewSystemServiceClient ¶
func NewSystemServiceClient(cc grpc.ClientConnInterface) SystemServiceClient
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) GetSetting(context.Context, *GetSettingRequest) (*GetSettingResponse, error)
func (UnimplementedSystemServiceServer) Info ¶
func (UnimplementedSystemServiceServer) Info(context.Context, *InfoRequest) (*InfoResponse, error)
func (UnimplementedSystemServiceServer) ResetSetting ¶
func (UnimplementedSystemServiceServer) ResetSetting(context.Context, *ResetSettingRequest) (*ResetSettingResponse, error)
func (UnimplementedSystemServiceServer) UpdateSetting ¶
func (UnimplementedSystemServiceServer) UpdateSetting(context.Context, *UpdateSettingRequest) (*UpdateSettingResponse, error)
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