v1

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	Goal_Type_name = map[int32]string{
		0: "EVENT",
		1: "PATH",
	}
	Goal_Type_value = map[string]int32{
		"EVENT": 0,
		"PATH":  1,
	}
)

Enum value maps for Goal_Type.

View Source
var (
	ErrInvalidLength        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflow          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group")
)
View Source
var File_vince_goals_v1_goals_proto protoreflect.FileDescriptor
View Source
var Goals_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "v1.Goals",
	HandlerType: (*GoalsServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateGoal",
			Handler:    _Goals_CreateGoal_Handler,
		},
		{
			MethodName: "GetGoal",
			Handler:    _Goals_GetGoal_Handler,
		},
		{
			MethodName: "ListGoals",
			Handler:    _Goals_ListGoals_Handler,
		},
		{
			MethodName: "DeleteGoal",
			Handler:    _Goals_DeleteGoal_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "vince/goals/v1/goals.proto",
}

Goals_ServiceDesc is the grpc.ServiceDesc for Goals service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterGoalsHandler

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

RegisterGoalsHandler registers the http handlers for service Goals to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterGoalsHandlerClient

func RegisterGoalsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GoalsClient) error

RegisterGoalsHandlerClient registers the http handlers for service Goals to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "GoalsClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "GoalsClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "GoalsClient" to call the correct interceptors.

func RegisterGoalsHandlerFromEndpoint

func RegisterGoalsHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterGoalsHandlerFromEndpoint is same as RegisterGoalsHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterGoalsHandlerServer

func RegisterGoalsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GoalsServer) error

RegisterGoalsHandlerServer registers the http handlers for service Goals to "mux". UnaryRPC :call GoalsServer 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 RegisterGoalsHandlerFromEndpoint instead.

func RegisterGoalsServer

func RegisterGoalsServer(s grpc.ServiceRegistrar, srv GoalsServer)

Types

type CreateGoalRequest

type CreateGoalRequest struct {
	Domain string    `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"`
	Type   Goal_Type `protobuf:"varint,2,opt,name=type,proto3,enum=v1.Goal_Type" json:"type,omitempty"`
	Value  string    `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateGoalRequest) Descriptor deprecated

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

Deprecated: Use CreateGoalRequest.ProtoReflect.Descriptor instead.

func (*CreateGoalRequest) GetDomain

func (x *CreateGoalRequest) GetDomain() string

func (*CreateGoalRequest) GetType

func (x *CreateGoalRequest) GetType() Goal_Type

func (*CreateGoalRequest) GetValue

func (x *CreateGoalRequest) GetValue() string

func (*CreateGoalRequest) MarshalToSizedBufferVT

func (m *CreateGoalRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*CreateGoalRequest) MarshalToVT

func (m *CreateGoalRequest) MarshalToVT(dAtA []byte) (int, error)

func (*CreateGoalRequest) MarshalVT

func (m *CreateGoalRequest) MarshalVT() (dAtA []byte, err error)

func (*CreateGoalRequest) ProtoMessage

func (*CreateGoalRequest) ProtoMessage()

func (*CreateGoalRequest) ProtoReflect

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

func (*CreateGoalRequest) Reset

func (x *CreateGoalRequest) Reset()

func (*CreateGoalRequest) SizeVT

func (m *CreateGoalRequest) SizeVT() (n int)

func (*CreateGoalRequest) String

func (x *CreateGoalRequest) String() string

func (*CreateGoalRequest) UnmarshalVT

func (m *CreateGoalRequest) UnmarshalVT(dAtA []byte) error

type CreateGoalResponse

type CreateGoalResponse struct {
	Goal *Goal `protobuf:"bytes,1,opt,name=goal,proto3" json:"goal,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateGoalResponse) Descriptor deprecated

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

Deprecated: Use CreateGoalResponse.ProtoReflect.Descriptor instead.

func (*CreateGoalResponse) GetGoal

func (x *CreateGoalResponse) GetGoal() *Goal

func (*CreateGoalResponse) MarshalToSizedBufferVT

func (m *CreateGoalResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*CreateGoalResponse) MarshalToVT

func (m *CreateGoalResponse) MarshalToVT(dAtA []byte) (int, error)

func (*CreateGoalResponse) MarshalVT

func (m *CreateGoalResponse) MarshalVT() (dAtA []byte, err error)

func (*CreateGoalResponse) ProtoMessage

func (*CreateGoalResponse) ProtoMessage()

func (*CreateGoalResponse) ProtoReflect

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

func (*CreateGoalResponse) Reset

func (x *CreateGoalResponse) Reset()

func (*CreateGoalResponse) SizeVT

func (m *CreateGoalResponse) SizeVT() (n int)

func (*CreateGoalResponse) String

func (x *CreateGoalResponse) String() string

func (*CreateGoalResponse) UnmarshalVT

func (m *CreateGoalResponse) UnmarshalVT(dAtA []byte) error

type DeleteGoalRequest

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

func (*DeleteGoalRequest) Descriptor deprecated

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

Deprecated: Use DeleteGoalRequest.ProtoReflect.Descriptor instead.

func (*DeleteGoalRequest) GetId

func (x *DeleteGoalRequest) GetId() string

func (*DeleteGoalRequest) MarshalToSizedBufferVT

func (m *DeleteGoalRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*DeleteGoalRequest) MarshalToVT

func (m *DeleteGoalRequest) MarshalToVT(dAtA []byte) (int, error)

func (*DeleteGoalRequest) MarshalVT

func (m *DeleteGoalRequest) MarshalVT() (dAtA []byte, err error)

func (*DeleteGoalRequest) ProtoMessage

func (*DeleteGoalRequest) ProtoMessage()

func (*DeleteGoalRequest) ProtoReflect

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

func (*DeleteGoalRequest) Reset

func (x *DeleteGoalRequest) Reset()

func (*DeleteGoalRequest) SizeVT

func (m *DeleteGoalRequest) SizeVT() (n int)

func (*DeleteGoalRequest) String

func (x *DeleteGoalRequest) String() string

func (*DeleteGoalRequest) UnmarshalVT

func (m *DeleteGoalRequest) UnmarshalVT(dAtA []byte) error

type DeleteGoalResponse

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

func (*DeleteGoalResponse) Descriptor deprecated

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

Deprecated: Use DeleteGoalResponse.ProtoReflect.Descriptor instead.

func (*DeleteGoalResponse) MarshalToSizedBufferVT

func (m *DeleteGoalResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*DeleteGoalResponse) MarshalToVT

func (m *DeleteGoalResponse) MarshalToVT(dAtA []byte) (int, error)

func (*DeleteGoalResponse) MarshalVT

func (m *DeleteGoalResponse) MarshalVT() (dAtA []byte, err error)

func (*DeleteGoalResponse) ProtoMessage

func (*DeleteGoalResponse) ProtoMessage()

func (*DeleteGoalResponse) ProtoReflect

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

func (*DeleteGoalResponse) Reset

func (x *DeleteGoalResponse) Reset()

func (*DeleteGoalResponse) SizeVT

func (m *DeleteGoalResponse) SizeVT() (n int)

func (*DeleteGoalResponse) String

func (x *DeleteGoalResponse) String() string

func (*DeleteGoalResponse) UnmarshalVT

func (m *DeleteGoalResponse) UnmarshalVT(dAtA []byte) error

type GetGoal

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

func (*GetGoal) Descriptor deprecated

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

Deprecated: Use GetGoal.ProtoReflect.Descriptor instead.

func (*GetGoal) GetId

func (x *GetGoal) GetId() string

func (*GetGoal) MarshalToSizedBufferVT

func (m *GetGoal) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*GetGoal) MarshalToVT

func (m *GetGoal) MarshalToVT(dAtA []byte) (int, error)

func (*GetGoal) MarshalVT

func (m *GetGoal) MarshalVT() (dAtA []byte, err error)

func (*GetGoal) ProtoMessage

func (*GetGoal) ProtoMessage()

func (*GetGoal) ProtoReflect

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

func (*GetGoal) Reset

func (x *GetGoal) Reset()

func (*GetGoal) SizeVT

func (m *GetGoal) SizeVT() (n int)

func (*GetGoal) String

func (x *GetGoal) String() string

func (*GetGoal) UnmarshalVT

func (m *GetGoal) UnmarshalVT(dAtA []byte) error

type Goal

type Goal struct {
	Id        string               `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Type      Goal_Type            `protobuf:"varint,2,opt,name=type,proto3,enum=v1.Goal_Type" json:"type,omitempty"`
	Value     string               `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
	CreatedAt *durationpb.Duration `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

func (*Goal) Descriptor deprecated

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

Deprecated: Use Goal.ProtoReflect.Descriptor instead.

func (*Goal) GetCreatedAt

func (x *Goal) GetCreatedAt() *durationpb.Duration

func (*Goal) GetId

func (x *Goal) GetId() string

func (*Goal) GetType

func (x *Goal) GetType() Goal_Type

func (*Goal) GetValue

func (x *Goal) GetValue() string

func (*Goal) MarshalToSizedBufferVT

func (m *Goal) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Goal) MarshalToVT

func (m *Goal) MarshalToVT(dAtA []byte) (int, error)

func (*Goal) MarshalVT

func (m *Goal) MarshalVT() (dAtA []byte, err error)

func (*Goal) ProtoMessage

func (*Goal) ProtoMessage()

func (*Goal) ProtoReflect

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

func (*Goal) Reset

func (x *Goal) Reset()

func (*Goal) SizeVT

func (m *Goal) SizeVT() (n int)

func (*Goal) String

func (x *Goal) String() string

func (*Goal) UnmarshalVT

func (m *Goal) UnmarshalVT(dAtA []byte) error

type Goal_Type

type Goal_Type int32
const (
	Goal_EVENT Goal_Type = 0
	Goal_PATH  Goal_Type = 1
)

func (Goal_Type) Descriptor

func (Goal_Type) Descriptor() protoreflect.EnumDescriptor

func (Goal_Type) Enum

func (x Goal_Type) Enum() *Goal_Type

func (Goal_Type) EnumDescriptor deprecated

func (Goal_Type) EnumDescriptor() ([]byte, []int)

Deprecated: Use Goal_Type.Descriptor instead.

func (Goal_Type) Number

func (x Goal_Type) Number() protoreflect.EnumNumber

func (Goal_Type) String

func (x Goal_Type) String() string

func (Goal_Type) Type

type GoalsClient

type GoalsClient interface {
	CreateGoal(ctx context.Context, in *CreateGoalRequest, opts ...grpc.CallOption) (*CreateGoalResponse, error)
	GetGoal(ctx context.Context, in *ListGoalsRequest, opts ...grpc.CallOption) (*Goal, error)
	ListGoals(ctx context.Context, in *ListGoalsRequest, opts ...grpc.CallOption) (*ListGoalsResponse, error)
	DeleteGoal(ctx context.Context, in *DeleteGoalRequest, opts ...grpc.CallOption) (*DeleteGoalResponse, error)
}

GoalsClient is the client API for Goals 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 NewGoalsClient

func NewGoalsClient(cc grpc.ClientConnInterface) GoalsClient

type GoalsServer

type GoalsServer interface {
	CreateGoal(context.Context, *CreateGoalRequest) (*CreateGoalResponse, error)
	GetGoal(context.Context, *ListGoalsRequest) (*Goal, error)
	ListGoals(context.Context, *ListGoalsRequest) (*ListGoalsResponse, error)
	DeleteGoal(context.Context, *DeleteGoalRequest) (*DeleteGoalResponse, error)
	// contains filtered or unexported methods
}

GoalsServer is the server API for Goals service. All implementations must embed UnimplementedGoalsServer for forward compatibility

type ListGoalsRequest

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

func (*ListGoalsRequest) Descriptor deprecated

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

Deprecated: Use ListGoalsRequest.ProtoReflect.Descriptor instead.

func (*ListGoalsRequest) MarshalToSizedBufferVT

func (m *ListGoalsRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*ListGoalsRequest) MarshalToVT

func (m *ListGoalsRequest) MarshalToVT(dAtA []byte) (int, error)

func (*ListGoalsRequest) MarshalVT

func (m *ListGoalsRequest) MarshalVT() (dAtA []byte, err error)

func (*ListGoalsRequest) ProtoMessage

func (*ListGoalsRequest) ProtoMessage()

func (*ListGoalsRequest) ProtoReflect

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

func (*ListGoalsRequest) Reset

func (x *ListGoalsRequest) Reset()

func (*ListGoalsRequest) SizeVT

func (m *ListGoalsRequest) SizeVT() (n int)

func (*ListGoalsRequest) String

func (x *ListGoalsRequest) String() string

func (*ListGoalsRequest) UnmarshalVT

func (m *ListGoalsRequest) UnmarshalVT(dAtA []byte) error

type ListGoalsResponse

type ListGoalsResponse struct {
	Goals []*Goal `protobuf:"bytes,1,rep,name=goals,proto3" json:"goals,omitempty"`
	// contains filtered or unexported fields
}

func (*ListGoalsResponse) Descriptor deprecated

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

Deprecated: Use ListGoalsResponse.ProtoReflect.Descriptor instead.

func (*ListGoalsResponse) GetGoals

func (x *ListGoalsResponse) GetGoals() []*Goal

func (*ListGoalsResponse) MarshalToSizedBufferVT

func (m *ListGoalsResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*ListGoalsResponse) MarshalToVT

func (m *ListGoalsResponse) MarshalToVT(dAtA []byte) (int, error)

func (*ListGoalsResponse) MarshalVT

func (m *ListGoalsResponse) MarshalVT() (dAtA []byte, err error)

func (*ListGoalsResponse) ProtoMessage

func (*ListGoalsResponse) ProtoMessage()

func (*ListGoalsResponse) ProtoReflect

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

func (*ListGoalsResponse) Reset

func (x *ListGoalsResponse) Reset()

func (*ListGoalsResponse) SizeVT

func (m *ListGoalsResponse) SizeVT() (n int)

func (*ListGoalsResponse) String

func (x *ListGoalsResponse) String() string

func (*ListGoalsResponse) UnmarshalVT

func (m *ListGoalsResponse) UnmarshalVT(dAtA []byte) error

type UnimplementedGoalsServer

type UnimplementedGoalsServer struct {
}

UnimplementedGoalsServer must be embedded to have forward compatible implementations.

func (UnimplementedGoalsServer) CreateGoal

func (UnimplementedGoalsServer) DeleteGoal

func (UnimplementedGoalsServer) GetGoal

func (UnimplementedGoalsServer) ListGoals

type UnsafeGoalsServer

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

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

Jump to

Keyboard shortcuts

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