Documentation ¶
Overview ¶
Package statesvc is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterStateHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterStateHandlerClient(ctx context.Context, mux *runtime.ServeMux, client StateClient) error
- func RegisterStateHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterStateHandlerServer(ctx context.Context, mux *runtime.ServeMux, server StateServer) error
- func RegisterStateServer(s grpc.ServiceRegistrar, srv StateServer)
- type GetRequest
- func (*GetRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetRequest) GetMetadata() *ValueMetadata
- func (x *GetRequest) GetName() string
- func (x *GetRequest) GetProjectId() string
- func (*GetRequest) ProtoMessage()
- func (x *GetRequest) ProtoReflect() protoreflect.Message
- func (x *GetRequest) Reset()
- func (x *GetRequest) String() string
- func (m *GetRequest) Validate() error
- type GetRequestValidationError
- type GetResponse
- func (*GetResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetResponse) GetMetadata() *ValueMetadata
- func (x *GetResponse) GetValue() *values.Value
- func (*GetResponse) ProtoMessage()
- func (x *GetResponse) ProtoReflect() protoreflect.Message
- func (x *GetResponse) Reset()
- func (x *GetResponse) String() string
- func (m *GetResponse) Validate() error
- type GetResponseValidationError
- func (e GetResponseValidationError) Cause() error
- func (e GetResponseValidationError) Error() string
- func (e GetResponseValidationError) ErrorName() string
- func (e GetResponseValidationError) Field() string
- func (e GetResponseValidationError) Key() bool
- func (e GetResponseValidationError) Reason() string
- type ListRequest
- func (*ListRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListRequest) GetProjectId() string
- func (*ListRequest) ProtoMessage()
- func (x *ListRequest) ProtoReflect() protoreflect.Message
- func (x *ListRequest) Reset()
- func (x *ListRequest) String() string
- func (m *ListRequest) Validate() error
- type ListRequestValidationError
- func (e ListRequestValidationError) Cause() error
- func (e ListRequestValidationError) Error() string
- func (e ListRequestValidationError) ErrorName() string
- func (e ListRequestValidationError) Field() string
- func (e ListRequestValidationError) Key() bool
- func (e ListRequestValidationError) Reason() string
- type ListResponse
- func (*ListResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListResponse) GetNames() []string
- func (*ListResponse) ProtoMessage()
- func (x *ListResponse) ProtoReflect() protoreflect.Message
- func (x *ListResponse) Reset()
- func (x *ListResponse) String() string
- func (m *ListResponse) Validate() error
- type ListResponseValidationError
- func (e ListResponseValidationError) Cause() error
- func (e ListResponseValidationError) Error() string
- func (e ListResponseValidationError) ErrorName() string
- func (e ListResponseValidationError) Field() string
- func (e ListResponseValidationError) Key() bool
- func (e ListResponseValidationError) Reason() string
- type SetRequest
- func (*SetRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SetRequest) GetName() string
- func (x *SetRequest) GetProjectId() string
- func (x *SetRequest) GetValue() *values.Value
- func (*SetRequest) ProtoMessage()
- func (x *SetRequest) ProtoReflect() protoreflect.Message
- func (x *SetRequest) Reset()
- func (x *SetRequest) String() string
- func (m *SetRequest) Validate() error
- type SetRequestValidationError
- type SetResponse
- type SetResponseValidationError
- func (e SetResponseValidationError) Cause() error
- func (e SetResponseValidationError) Error() string
- func (e SetResponseValidationError) ErrorName() string
- func (e SetResponseValidationError) Field() string
- func (e SetResponseValidationError) Key() bool
- func (e SetResponseValidationError) Reason() string
- type StateClient
- type StateServer
- type UnimplementedStateServer
- type UnsafeStateServer
- type ValueMetadata
- func (*ValueMetadata) Descriptor() ([]byte, []int)deprecated
- func (x *ValueMetadata) GetUpdatedAt() *timestamppb.Timestamp
- func (*ValueMetadata) ProtoMessage()
- func (x *ValueMetadata) ProtoReflect() protoreflect.Message
- func (x *ValueMetadata) Reset()
- func (x *ValueMetadata) String() string
- func (m *ValueMetadata) Validate() error
- type ValueMetadataValidationError
- func (e ValueMetadataValidationError) Cause() error
- func (e ValueMetadataValidationError) Error() string
- func (e ValueMetadataValidationError) ErrorName() string
- func (e ValueMetadataValidationError) Field() string
- func (e ValueMetadataValidationError) Key() bool
- func (e ValueMetadataValidationError) Reason() string
Constants ¶
This section is empty.
Variables ¶
var File_statesvc_statesvc_proto protoreflect.FileDescriptor
var State_ServiceDesc = grpc.ServiceDesc{ ServiceName: "autokitteh.statesvc.State", HandlerType: (*StateServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Set", Handler: _State_Set_Handler, }, { MethodName: "Get", Handler: _State_Get_Handler, }, { MethodName: "List", Handler: _State_List_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "statesvc/statesvc.proto", }
State_ServiceDesc is the grpc.ServiceDesc for State service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterStateHandler ¶
RegisterStateHandler registers the http handlers for service State to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterStateHandlerClient ¶
func RegisterStateHandlerClient(ctx context.Context, mux *runtime.ServeMux, client StateClient) error
RegisterStateHandlerClient registers the http handlers for service State to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "StateClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "StateClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "StateClient" to call the correct interceptors.
func RegisterStateHandlerFromEndpoint ¶
func RegisterStateHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterStateHandlerFromEndpoint is same as RegisterStateHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterStateHandlerServer ¶
func RegisterStateHandlerServer(ctx context.Context, mux *runtime.ServeMux, server StateServer) error
RegisterStateHandlerServer registers the http handlers for service State to "mux". UnaryRPC :call StateServer 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 RegisterStateHandlerFromEndpoint instead.
func RegisterStateServer ¶
func RegisterStateServer(s grpc.ServiceRegistrar, srv StateServer)
Types ¶
type GetRequest ¶
type GetRequest struct { ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Metadata *ValueMetadata `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` // contains filtered or unexported fields }
func (*GetRequest) Descriptor
deprecated
func (*GetRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.
func (*GetRequest) GetMetadata ¶
func (x *GetRequest) GetMetadata() *ValueMetadata
func (*GetRequest) GetName ¶
func (x *GetRequest) GetName() string
func (*GetRequest) GetProjectId ¶
func (x *GetRequest) GetProjectId() string
func (*GetRequest) ProtoMessage ¶
func (*GetRequest) ProtoMessage()
func (*GetRequest) ProtoReflect ¶
func (x *GetRequest) ProtoReflect() protoreflect.Message
func (*GetRequest) Reset ¶
func (x *GetRequest) Reset()
func (*GetRequest) String ¶
func (x *GetRequest) String() string
func (*GetRequest) Validate ¶
func (m *GetRequest) Validate() error
Validate checks the field values on GetRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type GetRequestValidationError ¶
type GetRequestValidationError struct {
// contains filtered or unexported fields
}
GetRequestValidationError is the validation error returned by GetRequest.Validate if the designated constraints aren't met.
func (GetRequestValidationError) Cause ¶
func (e GetRequestValidationError) Cause() error
Cause function returns cause value.
func (GetRequestValidationError) Error ¶
func (e GetRequestValidationError) Error() string
Error satisfies the builtin error interface
func (GetRequestValidationError) ErrorName ¶
func (e GetRequestValidationError) ErrorName() string
ErrorName returns error name.
func (GetRequestValidationError) Field ¶
func (e GetRequestValidationError) Field() string
Field function returns field value.
func (GetRequestValidationError) Key ¶
func (e GetRequestValidationError) Key() bool
Key function returns key value.
func (GetRequestValidationError) Reason ¶
func (e GetRequestValidationError) Reason() string
Reason function returns reason value.
type GetResponse ¶
type GetResponse struct { Value *values.Value `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` Metadata *ValueMetadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` // contains filtered or unexported fields }
func (*GetResponse) Descriptor
deprecated
func (*GetResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.
func (*GetResponse) GetMetadata ¶
func (x *GetResponse) GetMetadata() *ValueMetadata
func (*GetResponse) GetValue ¶
func (x *GetResponse) GetValue() *values.Value
func (*GetResponse) ProtoMessage ¶
func (*GetResponse) ProtoMessage()
func (*GetResponse) ProtoReflect ¶
func (x *GetResponse) ProtoReflect() protoreflect.Message
func (*GetResponse) Reset ¶
func (x *GetResponse) Reset()
func (*GetResponse) String ¶
func (x *GetResponse) String() string
func (*GetResponse) Validate ¶
func (m *GetResponse) Validate() error
Validate checks the field values on GetResponse with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type GetResponseValidationError ¶
type GetResponseValidationError struct {
// contains filtered or unexported fields
}
GetResponseValidationError is the validation error returned by GetResponse.Validate if the designated constraints aren't met.
func (GetResponseValidationError) Cause ¶
func (e GetResponseValidationError) Cause() error
Cause function returns cause value.
func (GetResponseValidationError) Error ¶
func (e GetResponseValidationError) Error() string
Error satisfies the builtin error interface
func (GetResponseValidationError) ErrorName ¶
func (e GetResponseValidationError) ErrorName() string
ErrorName returns error name.
func (GetResponseValidationError) Field ¶
func (e GetResponseValidationError) Field() string
Field function returns field value.
func (GetResponseValidationError) Key ¶
func (e GetResponseValidationError) Key() bool
Key function returns key value.
func (GetResponseValidationError) Reason ¶
func (e GetResponseValidationError) Reason() string
Reason function returns reason value.
type ListRequest ¶
type ListRequest struct { ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` // contains filtered or unexported fields }
func (*ListRequest) Descriptor
deprecated
func (*ListRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.
func (*ListRequest) GetProjectId ¶
func (x *ListRequest) GetProjectId() string
func (*ListRequest) ProtoMessage ¶
func (*ListRequest) ProtoMessage()
func (*ListRequest) ProtoReflect ¶
func (x *ListRequest) ProtoReflect() protoreflect.Message
func (*ListRequest) Reset ¶
func (x *ListRequest) Reset()
func (*ListRequest) String ¶
func (x *ListRequest) String() string
func (*ListRequest) Validate ¶
func (m *ListRequest) Validate() error
Validate checks the field values on ListRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type ListRequestValidationError ¶
type ListRequestValidationError struct {
// contains filtered or unexported fields
}
ListRequestValidationError is the validation error returned by ListRequest.Validate if the designated constraints aren't met.
func (ListRequestValidationError) Cause ¶
func (e ListRequestValidationError) Cause() error
Cause function returns cause value.
func (ListRequestValidationError) Error ¶
func (e ListRequestValidationError) Error() string
Error satisfies the builtin error interface
func (ListRequestValidationError) ErrorName ¶
func (e ListRequestValidationError) ErrorName() string
ErrorName returns error name.
func (ListRequestValidationError) Field ¶
func (e ListRequestValidationError) Field() string
Field function returns field value.
func (ListRequestValidationError) Key ¶
func (e ListRequestValidationError) Key() bool
Key function returns key value.
func (ListRequestValidationError) Reason ¶
func (e ListRequestValidationError) Reason() string
Reason function returns reason value.
type ListResponse ¶
type ListResponse struct { Names []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"` // contains filtered or unexported fields }
func (*ListResponse) Descriptor
deprecated
func (*ListResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.
func (*ListResponse) GetNames ¶
func (x *ListResponse) GetNames() []string
func (*ListResponse) ProtoMessage ¶
func (*ListResponse) ProtoMessage()
func (*ListResponse) ProtoReflect ¶
func (x *ListResponse) ProtoReflect() protoreflect.Message
func (*ListResponse) Reset ¶
func (x *ListResponse) Reset()
func (*ListResponse) String ¶
func (x *ListResponse) String() string
func (*ListResponse) Validate ¶
func (m *ListResponse) Validate() error
Validate checks the field values on ListResponse with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type ListResponseValidationError ¶
type ListResponseValidationError struct {
// contains filtered or unexported fields
}
ListResponseValidationError is the validation error returned by ListResponse.Validate if the designated constraints aren't met.
func (ListResponseValidationError) Cause ¶
func (e ListResponseValidationError) Cause() error
Cause function returns cause value.
func (ListResponseValidationError) Error ¶
func (e ListResponseValidationError) Error() string
Error satisfies the builtin error interface
func (ListResponseValidationError) ErrorName ¶
func (e ListResponseValidationError) ErrorName() string
ErrorName returns error name.
func (ListResponseValidationError) Field ¶
func (e ListResponseValidationError) Field() string
Field function returns field value.
func (ListResponseValidationError) Key ¶
func (e ListResponseValidationError) Key() bool
Key function returns key value.
func (ListResponseValidationError) Reason ¶
func (e ListResponseValidationError) Reason() string
Reason function returns reason value.
type SetRequest ¶
type SetRequest struct { ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Value *values.Value `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` // omit to delete. // contains filtered or unexported fields }
func (*SetRequest) Descriptor
deprecated
func (*SetRequest) Descriptor() ([]byte, []int)
Deprecated: Use SetRequest.ProtoReflect.Descriptor instead.
func (*SetRequest) GetName ¶
func (x *SetRequest) GetName() string
func (*SetRequest) GetProjectId ¶
func (x *SetRequest) GetProjectId() string
func (*SetRequest) GetValue ¶
func (x *SetRequest) GetValue() *values.Value
func (*SetRequest) ProtoMessage ¶
func (*SetRequest) ProtoMessage()
func (*SetRequest) ProtoReflect ¶
func (x *SetRequest) ProtoReflect() protoreflect.Message
func (*SetRequest) Reset ¶
func (x *SetRequest) Reset()
func (*SetRequest) String ¶
func (x *SetRequest) String() string
func (*SetRequest) Validate ¶
func (m *SetRequest) Validate() error
Validate checks the field values on SetRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type SetRequestValidationError ¶
type SetRequestValidationError struct {
// contains filtered or unexported fields
}
SetRequestValidationError is the validation error returned by SetRequest.Validate if the designated constraints aren't met.
func (SetRequestValidationError) Cause ¶
func (e SetRequestValidationError) Cause() error
Cause function returns cause value.
func (SetRequestValidationError) Error ¶
func (e SetRequestValidationError) Error() string
Error satisfies the builtin error interface
func (SetRequestValidationError) ErrorName ¶
func (e SetRequestValidationError) ErrorName() string
ErrorName returns error name.
func (SetRequestValidationError) Field ¶
func (e SetRequestValidationError) Field() string
Field function returns field value.
func (SetRequestValidationError) Key ¶
func (e SetRequestValidationError) Key() bool
Key function returns key value.
func (SetRequestValidationError) Reason ¶
func (e SetRequestValidationError) Reason() string
Reason function returns reason value.
type SetResponse ¶
type SetResponse struct {
// contains filtered or unexported fields
}
func (*SetResponse) Descriptor
deprecated
func (*SetResponse) Descriptor() ([]byte, []int)
Deprecated: Use SetResponse.ProtoReflect.Descriptor instead.
func (*SetResponse) ProtoMessage ¶
func (*SetResponse) ProtoMessage()
func (*SetResponse) ProtoReflect ¶
func (x *SetResponse) ProtoReflect() protoreflect.Message
func (*SetResponse) Reset ¶
func (x *SetResponse) Reset()
func (*SetResponse) String ¶
func (x *SetResponse) String() string
func (*SetResponse) Validate ¶
func (m *SetResponse) Validate() error
Validate checks the field values on SetResponse with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type SetResponseValidationError ¶
type SetResponseValidationError struct {
// contains filtered or unexported fields
}
SetResponseValidationError is the validation error returned by SetResponse.Validate if the designated constraints aren't met.
func (SetResponseValidationError) Cause ¶
func (e SetResponseValidationError) Cause() error
Cause function returns cause value.
func (SetResponseValidationError) Error ¶
func (e SetResponseValidationError) Error() string
Error satisfies the builtin error interface
func (SetResponseValidationError) ErrorName ¶
func (e SetResponseValidationError) ErrorName() string
ErrorName returns error name.
func (SetResponseValidationError) Field ¶
func (e SetResponseValidationError) Field() string
Field function returns field value.
func (SetResponseValidationError) Key ¶
func (e SetResponseValidationError) Key() bool
Key function returns key value.
func (SetResponseValidationError) Reason ¶
func (e SetResponseValidationError) Reason() string
Reason function returns reason value.
type StateClient ¶
type StateClient interface { Set(ctx context.Context, in *SetRequest, opts ...grpc.CallOption) (*SetResponse, error) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) }
StateClient is the client API for State 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 NewStateClient ¶
func NewStateClient(cc grpc.ClientConnInterface) StateClient
type StateServer ¶
type StateServer interface { Set(context.Context, *SetRequest) (*SetResponse, error) Get(context.Context, *GetRequest) (*GetResponse, error) List(context.Context, *ListRequest) (*ListResponse, error) // contains filtered or unexported methods }
StateServer is the server API for State service. All implementations must embed UnimplementedStateServer for forward compatibility
type UnimplementedStateServer ¶
type UnimplementedStateServer struct { }
UnimplementedStateServer must be embedded to have forward compatible implementations.
func (UnimplementedStateServer) Get ¶
func (UnimplementedStateServer) Get(context.Context, *GetRequest) (*GetResponse, error)
func (UnimplementedStateServer) List ¶
func (UnimplementedStateServer) List(context.Context, *ListRequest) (*ListResponse, error)
func (UnimplementedStateServer) Set ¶
func (UnimplementedStateServer) Set(context.Context, *SetRequest) (*SetResponse, error)
type UnsafeStateServer ¶
type UnsafeStateServer interface {
// contains filtered or unexported methods
}
UnsafeStateServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to StateServer will result in compilation errors.
type ValueMetadata ¶
type ValueMetadata struct { UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // contains filtered or unexported fields }
func (*ValueMetadata) Descriptor
deprecated
func (*ValueMetadata) Descriptor() ([]byte, []int)
Deprecated: Use ValueMetadata.ProtoReflect.Descriptor instead.
func (*ValueMetadata) GetUpdatedAt ¶
func (x *ValueMetadata) GetUpdatedAt() *timestamppb.Timestamp
func (*ValueMetadata) ProtoMessage ¶
func (*ValueMetadata) ProtoMessage()
func (*ValueMetadata) ProtoReflect ¶
func (x *ValueMetadata) ProtoReflect() protoreflect.Message
func (*ValueMetadata) Reset ¶
func (x *ValueMetadata) Reset()
func (*ValueMetadata) String ¶
func (x *ValueMetadata) String() string
func (*ValueMetadata) Validate ¶
func (m *ValueMetadata) Validate() error
Validate checks the field values on ValueMetadata with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type ValueMetadataValidationError ¶
type ValueMetadataValidationError struct {
// contains filtered or unexported fields
}
ValueMetadataValidationError is the validation error returned by ValueMetadata.Validate if the designated constraints aren't met.
func (ValueMetadataValidationError) Cause ¶
func (e ValueMetadataValidationError) Cause() error
Cause function returns cause value.
func (ValueMetadataValidationError) Error ¶
func (e ValueMetadataValidationError) Error() string
Error satisfies the builtin error interface
func (ValueMetadataValidationError) ErrorName ¶
func (e ValueMetadataValidationError) ErrorName() string
ErrorName returns error name.
func (ValueMetadataValidationError) Field ¶
func (e ValueMetadataValidationError) Field() string
Field function returns field value.
func (ValueMetadataValidationError) Key ¶
func (e ValueMetadataValidationError) Key() bool
Key function returns key value.
func (ValueMetadataValidationError) Reason ¶
func (e ValueMetadataValidationError) Reason() string
Reason function returns reason value.