statesvc

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

Package statesvc is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_statesvc_statesvc_proto protoreflect.FileDescriptor
View Source
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

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

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

Error satisfies the builtin error interface

func (GetRequestValidationError) ErrorName

func (e GetRequestValidationError) ErrorName() string

ErrorName returns error name.

func (GetRequestValidationError) Field

Field function returns field value.

func (GetRequestValidationError) Key

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

Cause function returns cause value.

func (GetResponseValidationError) Error

Error satisfies the builtin error interface

func (GetResponseValidationError) ErrorName

func (e GetResponseValidationError) ErrorName() string

ErrorName returns error name.

func (GetResponseValidationError) Field

Field function returns field value.

func (GetResponseValidationError) Key

Key function returns key value.

func (GetResponseValidationError) Reason

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

Cause function returns cause value.

func (ListRequestValidationError) Error

Error satisfies the builtin error interface

func (ListRequestValidationError) ErrorName

func (e ListRequestValidationError) ErrorName() string

ErrorName returns error name.

func (ListRequestValidationError) Field

Field function returns field value.

func (ListRequestValidationError) Key

Key function returns key value.

func (ListRequestValidationError) Reason

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

Cause function returns cause value.

func (ListResponseValidationError) Error

Error satisfies the builtin error interface

func (ListResponseValidationError) ErrorName

func (e ListResponseValidationError) ErrorName() string

ErrorName returns error name.

func (ListResponseValidationError) Field

Field function returns field value.

func (ListResponseValidationError) Key

Key function returns key value.

func (ListResponseValidationError) Reason

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

Error satisfies the builtin error interface

func (SetRequestValidationError) ErrorName

func (e SetRequestValidationError) ErrorName() string

ErrorName returns error name.

func (SetRequestValidationError) Field

Field function returns field value.

func (SetRequestValidationError) Key

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

Cause function returns cause value.

func (SetResponseValidationError) Error

Error satisfies the builtin error interface

func (SetResponseValidationError) ErrorName

func (e SetResponseValidationError) ErrorName() string

ErrorName returns error name.

func (SetResponseValidationError) Field

Field function returns field value.

func (SetResponseValidationError) Key

Key function returns key value.

func (SetResponseValidationError) Reason

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) List

func (UnimplementedStateServer) Set

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

Cause function returns cause value.

func (ValueMetadataValidationError) Error

Error satisfies the builtin error interface

func (ValueMetadataValidationError) ErrorName

func (e ValueMetadataValidationError) ErrorName() string

ErrorName returns error name.

func (ValueMetadataValidationError) Field

Field function returns field value.

func (ValueMetadataValidationError) Key

Key function returns key value.

func (ValueMetadataValidationError) Reason

Reason function returns reason value.

Jump to

Keyboard shortcuts

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