Commit: Bulk unfinished work

This commit is contained in:
2026-01-22 17:39:04 +01:00
parent 6c46b4efcc
commit 3a9acc42a2
68 changed files with 5047 additions and 1064 deletions

View File

@@ -0,0 +1,532 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.10
// protoc (unknown)
// source: mandant/v1/mandant.proto
package mandantv1
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type GetCurrentTenantRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GetCurrentTenantRequest) Reset() {
*x = GetCurrentTenantRequest{}
mi := &file_mandant_v1_mandant_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *GetCurrentTenantRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetCurrentTenantRequest) ProtoMessage() {}
func (x *GetCurrentTenantRequest) ProtoReflect() protoreflect.Message {
mi := &file_mandant_v1_mandant_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetCurrentTenantRequest.ProtoReflect.Descriptor instead.
func (*GetCurrentTenantRequest) Descriptor() ([]byte, []int) {
return file_mandant_v1_mandant_proto_rawDescGZIP(), []int{0}
}
type GetTenantRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GetTenantRequest) Reset() {
*x = GetTenantRequest{}
mi := &file_mandant_v1_mandant_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *GetTenantRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetTenantRequest) ProtoMessage() {}
func (x *GetTenantRequest) ProtoReflect() protoreflect.Message {
mi := &file_mandant_v1_mandant_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetTenantRequest.ProtoReflect.Descriptor instead.
func (*GetTenantRequest) Descriptor() ([]byte, []int) {
return file_mandant_v1_mandant_proto_rawDescGZIP(), []int{1}
}
func (x *GetTenantRequest) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
type GetTenantResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Plan string `protobuf:"bytes,3,opt,name=plan,proto3" json:"plan,omitempty"`
Logo string `protobuf:"bytes,4,opt,name=logo,proto3" json:"logo,omitempty"`
Color string `protobuf:"bytes,5,opt,name=color,proto3" json:"color,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GetTenantResponse) Reset() {
*x = GetTenantResponse{}
mi := &file_mandant_v1_mandant_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *GetTenantResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetTenantResponse) ProtoMessage() {}
func (x *GetTenantResponse) ProtoReflect() protoreflect.Message {
mi := &file_mandant_v1_mandant_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetTenantResponse.ProtoReflect.Descriptor instead.
func (*GetTenantResponse) Descriptor() ([]byte, []int) {
return file_mandant_v1_mandant_proto_rawDescGZIP(), []int{2}
}
func (x *GetTenantResponse) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *GetTenantResponse) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *GetTenantResponse) GetPlan() string {
if x != nil {
return x.Plan
}
return ""
}
func (x *GetTenantResponse) GetLogo() string {
if x != nil {
return x.Logo
}
return ""
}
func (x *GetTenantResponse) GetColor() string {
if x != nil {
return x.Color
}
return ""
}
type ListTenantRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
PerPage int32 `protobuf:"varint,2,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"`
OrberBy string `protobuf:"bytes,3,opt,name=orber_by,json=orberBy,proto3" json:"orber_by,omitempty"`
Asc bool `protobuf:"varint,4,opt,name=asc,proto3" json:"asc,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ListTenantRequest) Reset() {
*x = ListTenantRequest{}
mi := &file_mandant_v1_mandant_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ListTenantRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListTenantRequest) ProtoMessage() {}
func (x *ListTenantRequest) ProtoReflect() protoreflect.Message {
mi := &file_mandant_v1_mandant_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListTenantRequest.ProtoReflect.Descriptor instead.
func (*ListTenantRequest) Descriptor() ([]byte, []int) {
return file_mandant_v1_mandant_proto_rawDescGZIP(), []int{3}
}
func (x *ListTenantRequest) GetPage() int32 {
if x != nil {
return x.Page
}
return 0
}
func (x *ListTenantRequest) GetPerPage() int32 {
if x != nil {
return x.PerPage
}
return 0
}
func (x *ListTenantRequest) GetOrberBy() string {
if x != nil {
return x.OrberBy
}
return ""
}
func (x *ListTenantRequest) GetAsc() bool {
if x != nil {
return x.Asc
}
return false
}
type Metadata struct {
state protoimpl.MessageState `protogen:"open.v1"`
TotalCount int32 `protobuf:"varint,1,opt,name=totalCount,proto3" json:"totalCount,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Metadata) Reset() {
*x = Metadata{}
mi := &file_mandant_v1_mandant_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Metadata) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Metadata) ProtoMessage() {}
func (x *Metadata) ProtoReflect() protoreflect.Message {
mi := &file_mandant_v1_mandant_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Metadata.ProtoReflect.Descriptor instead.
func (*Metadata) Descriptor() ([]byte, []int) {
return file_mandant_v1_mandant_proto_rawDescGZIP(), []int{4}
}
func (x *Metadata) GetTotalCount() int32 {
if x != nil {
return x.TotalCount
}
return 0
}
type ListProjectsResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Data []*GetTenantResponse `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"`
Meta *Metadata `protobuf:"bytes,2,opt,name=meta,proto3" json:"meta,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ListProjectsResponse) Reset() {
*x = ListProjectsResponse{}
mi := &file_mandant_v1_mandant_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ListProjectsResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListProjectsResponse) ProtoMessage() {}
func (x *ListProjectsResponse) ProtoReflect() protoreflect.Message {
mi := &file_mandant_v1_mandant_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListProjectsResponse.ProtoReflect.Descriptor instead.
func (*ListProjectsResponse) Descriptor() ([]byte, []int) {
return file_mandant_v1_mandant_proto_rawDescGZIP(), []int{5}
}
func (x *ListProjectsResponse) GetData() []*GetTenantResponse {
if x != nil {
return x.Data
}
return nil
}
func (x *ListProjectsResponse) GetMeta() *Metadata {
if x != nil {
return x.Meta
}
return nil
}
type SetCurrentTenantRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
TenantId int64 `protobuf:"varint,1,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *SetCurrentTenantRequest) Reset() {
*x = SetCurrentTenantRequest{}
mi := &file_mandant_v1_mandant_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *SetCurrentTenantRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SetCurrentTenantRequest) ProtoMessage() {}
func (x *SetCurrentTenantRequest) ProtoReflect() protoreflect.Message {
mi := &file_mandant_v1_mandant_proto_msgTypes[6]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SetCurrentTenantRequest.ProtoReflect.Descriptor instead.
func (*SetCurrentTenantRequest) Descriptor() ([]byte, []int) {
return file_mandant_v1_mandant_proto_rawDescGZIP(), []int{6}
}
func (x *SetCurrentTenantRequest) GetTenantId() int64 {
if x != nil {
return x.TenantId
}
return 0
}
type SetCurrentTenantResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *SetCurrentTenantResponse) Reset() {
*x = SetCurrentTenantResponse{}
mi := &file_mandant_v1_mandant_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *SetCurrentTenantResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SetCurrentTenantResponse) ProtoMessage() {}
func (x *SetCurrentTenantResponse) ProtoReflect() protoreflect.Message {
mi := &file_mandant_v1_mandant_proto_msgTypes[7]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SetCurrentTenantResponse.ProtoReflect.Descriptor instead.
func (*SetCurrentTenantResponse) Descriptor() ([]byte, []int) {
return file_mandant_v1_mandant_proto_rawDescGZIP(), []int{7}
}
func (x *SetCurrentTenantResponse) GetSuccess() bool {
if x != nil {
return x.Success
}
return false
}
var File_mandant_v1_mandant_proto protoreflect.FileDescriptor
const file_mandant_v1_mandant_proto_rawDesc = "" +
"\n" +
"\x18mandant/v1/mandant.proto\x12\n" +
"mandant.v1\"\x19\n" +
"\x17GetCurrentTenantRequest\"\"\n" +
"\x10GetTenantRequest\x12\x0e\n" +
"\x02id\x18\x01 \x01(\x03R\x02id\"u\n" +
"\x11GetTenantResponse\x12\x0e\n" +
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x12\n" +
"\x04name\x18\x02 \x01(\tR\x04name\x12\x12\n" +
"\x04plan\x18\x03 \x01(\tR\x04plan\x12\x12\n" +
"\x04logo\x18\x04 \x01(\tR\x04logo\x12\x14\n" +
"\x05color\x18\x05 \x01(\tR\x05color\"o\n" +
"\x11ListTenantRequest\x12\x12\n" +
"\x04page\x18\x01 \x01(\x05R\x04page\x12\x19\n" +
"\bper_page\x18\x02 \x01(\x05R\aperPage\x12\x19\n" +
"\borber_by\x18\x03 \x01(\tR\aorberBy\x12\x10\n" +
"\x03asc\x18\x04 \x01(\bR\x03asc\"*\n" +
"\bMetadata\x12\x1e\n" +
"\n" +
"totalCount\x18\x01 \x01(\x05R\n" +
"totalCount\"s\n" +
"\x14ListProjectsResponse\x121\n" +
"\x04data\x18\x01 \x03(\v2\x1d.mandant.v1.GetTenantResponseR\x04data\x12(\n" +
"\x04meta\x18\x02 \x01(\v2\x14.mandant.v1.MetadataR\x04meta\"6\n" +
"\x17SetCurrentTenantRequest\x12\x1b\n" +
"\ttenant_id\x18\x01 \x01(\x03R\btenantId\"4\n" +
"\x18SetCurrentTenantResponse\x12\x18\n" +
"\asuccess\x18\x01 \x01(\bR\asuccess2\x99\x02\n" +
"\x0eMandantService\x12V\n" +
"\x10GetCurrentTenant\x12#.mandant.v1.GetCurrentTenantRequest\x1a\x1d.mandant.v1.GetTenantResponse\x12P\n" +
"\rGetAllTenants\x12\x1d.mandant.v1.ListTenantRequest\x1a .mandant.v1.ListProjectsResponse\x12]\n" +
"\x10SetCurrentTenant\x12#.mandant.v1.SetCurrentTenantRequest\x1a$.mandant.v1.SetCurrentTenantResponseB\x9c\x01\n" +
"\x0ecom.mandant.v1B\fMandantProtoP\x01Z3git.kocoder.xyz/kocoded/vt/gen/mandant/v1;mandantv1\xa2\x02\x03MXX\xaa\x02\n" +
"Mandant.V1\xca\x02\n" +
"Mandant\\V1\xe2\x02\x16Mandant\\V1\\GPBMetadata\xea\x02\vMandant::V1b\x06proto3"
var (
file_mandant_v1_mandant_proto_rawDescOnce sync.Once
file_mandant_v1_mandant_proto_rawDescData []byte
)
func file_mandant_v1_mandant_proto_rawDescGZIP() []byte {
file_mandant_v1_mandant_proto_rawDescOnce.Do(func() {
file_mandant_v1_mandant_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_mandant_v1_mandant_proto_rawDesc), len(file_mandant_v1_mandant_proto_rawDesc)))
})
return file_mandant_v1_mandant_proto_rawDescData
}
var file_mandant_v1_mandant_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_mandant_v1_mandant_proto_goTypes = []any{
(*GetCurrentTenantRequest)(nil), // 0: mandant.v1.GetCurrentTenantRequest
(*GetTenantRequest)(nil), // 1: mandant.v1.GetTenantRequest
(*GetTenantResponse)(nil), // 2: mandant.v1.GetTenantResponse
(*ListTenantRequest)(nil), // 3: mandant.v1.ListTenantRequest
(*Metadata)(nil), // 4: mandant.v1.Metadata
(*ListProjectsResponse)(nil), // 5: mandant.v1.ListProjectsResponse
(*SetCurrentTenantRequest)(nil), // 6: mandant.v1.SetCurrentTenantRequest
(*SetCurrentTenantResponse)(nil), // 7: mandant.v1.SetCurrentTenantResponse
}
var file_mandant_v1_mandant_proto_depIdxs = []int32{
2, // 0: mandant.v1.ListProjectsResponse.data:type_name -> mandant.v1.GetTenantResponse
4, // 1: mandant.v1.ListProjectsResponse.meta:type_name -> mandant.v1.Metadata
0, // 2: mandant.v1.MandantService.GetCurrentTenant:input_type -> mandant.v1.GetCurrentTenantRequest
3, // 3: mandant.v1.MandantService.GetAllTenants:input_type -> mandant.v1.ListTenantRequest
6, // 4: mandant.v1.MandantService.SetCurrentTenant:input_type -> mandant.v1.SetCurrentTenantRequest
2, // 5: mandant.v1.MandantService.GetCurrentTenant:output_type -> mandant.v1.GetTenantResponse
5, // 6: mandant.v1.MandantService.GetAllTenants:output_type -> mandant.v1.ListProjectsResponse
7, // 7: mandant.v1.MandantService.SetCurrentTenant:output_type -> mandant.v1.SetCurrentTenantResponse
5, // [5:8] is the sub-list for method output_type
2, // [2:5] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_mandant_v1_mandant_proto_init() }
func file_mandant_v1_mandant_proto_init() {
if File_mandant_v1_mandant_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_mandant_v1_mandant_proto_rawDesc), len(file_mandant_v1_mandant_proto_rawDesc)),
NumEnums: 0,
NumMessages: 8,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_mandant_v1_mandant_proto_goTypes,
DependencyIndexes: file_mandant_v1_mandant_proto_depIdxs,
MessageInfos: file_mandant_v1_mandant_proto_msgTypes,
}.Build()
File_mandant_v1_mandant_proto = out.File
file_mandant_v1_mandant_proto_goTypes = nil
file_mandant_v1_mandant_proto_depIdxs = nil
}

View File

@@ -0,0 +1,179 @@
// Code generated by protoc-gen-connect-go. DO NOT EDIT.
//
// Source: mandant/v1/mandant.proto
package mandantv1connect
import (
connect "connectrpc.com/connect"
context "context"
errors "errors"
v1 "git.kocoder.xyz/kocoded/vt/gen/mandant/v1"
http "net/http"
strings "strings"
)
// This is a compile-time assertion to ensure that this generated file and the connect package are
// compatible. If you get a compiler error that this constant is not defined, this code was
// generated with a version of connect newer than the one compiled into your binary. You can fix the
// problem by either regenerating this code with an older version of connect or updating the connect
// version compiled into your binary.
const _ = connect.IsAtLeastVersion1_13_0
const (
// MandantServiceName is the fully-qualified name of the MandantService service.
MandantServiceName = "mandant.v1.MandantService"
)
// These constants are the fully-qualified names of the RPCs defined in this package. They're
// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
//
// Note that these are different from the fully-qualified method names used by
// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
// period.
const (
// MandantServiceGetCurrentTenantProcedure is the fully-qualified name of the MandantService's
// GetCurrentTenant RPC.
MandantServiceGetCurrentTenantProcedure = "/mandant.v1.MandantService/GetCurrentTenant"
// MandantServiceGetAllTenantsProcedure is the fully-qualified name of the MandantService's
// GetAllTenants RPC.
MandantServiceGetAllTenantsProcedure = "/mandant.v1.MandantService/GetAllTenants"
// MandantServiceSetCurrentTenantProcedure is the fully-qualified name of the MandantService's
// SetCurrentTenant RPC.
MandantServiceSetCurrentTenantProcedure = "/mandant.v1.MandantService/SetCurrentTenant"
)
// MandantServiceClient is a client for the mandant.v1.MandantService service.
type MandantServiceClient interface {
GetCurrentTenant(context.Context, *v1.GetCurrentTenantRequest) (*v1.GetTenantResponse, error)
GetAllTenants(context.Context, *v1.ListTenantRequest) (*v1.ListProjectsResponse, error)
SetCurrentTenant(context.Context, *v1.SetCurrentTenantRequest) (*v1.SetCurrentTenantResponse, error)
}
// NewMandantServiceClient constructs a client for the mandant.v1.MandantService service. By
// default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses,
// and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the
// connect.WithGRPC() or connect.WithGRPCWeb() options.
//
// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
// http://api.acme.com or https://acme.com/grpc).
func NewMandantServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) MandantServiceClient {
baseURL = strings.TrimRight(baseURL, "/")
mandantServiceMethods := v1.File_mandant_v1_mandant_proto.Services().ByName("MandantService").Methods()
return &mandantServiceClient{
getCurrentTenant: connect.NewClient[v1.GetCurrentTenantRequest, v1.GetTenantResponse](
httpClient,
baseURL+MandantServiceGetCurrentTenantProcedure,
connect.WithSchema(mandantServiceMethods.ByName("GetCurrentTenant")),
connect.WithClientOptions(opts...),
),
getAllTenants: connect.NewClient[v1.ListTenantRequest, v1.ListProjectsResponse](
httpClient,
baseURL+MandantServiceGetAllTenantsProcedure,
connect.WithSchema(mandantServiceMethods.ByName("GetAllTenants")),
connect.WithClientOptions(opts...),
),
setCurrentTenant: connect.NewClient[v1.SetCurrentTenantRequest, v1.SetCurrentTenantResponse](
httpClient,
baseURL+MandantServiceSetCurrentTenantProcedure,
connect.WithSchema(mandantServiceMethods.ByName("SetCurrentTenant")),
connect.WithClientOptions(opts...),
),
}
}
// mandantServiceClient implements MandantServiceClient.
type mandantServiceClient struct {
getCurrentTenant *connect.Client[v1.GetCurrentTenantRequest, v1.GetTenantResponse]
getAllTenants *connect.Client[v1.ListTenantRequest, v1.ListProjectsResponse]
setCurrentTenant *connect.Client[v1.SetCurrentTenantRequest, v1.SetCurrentTenantResponse]
}
// GetCurrentTenant calls mandant.v1.MandantService.GetCurrentTenant.
func (c *mandantServiceClient) GetCurrentTenant(ctx context.Context, req *v1.GetCurrentTenantRequest) (*v1.GetTenantResponse, error) {
response, err := c.getCurrentTenant.CallUnary(ctx, connect.NewRequest(req))
if response != nil {
return response.Msg, err
}
return nil, err
}
// GetAllTenants calls mandant.v1.MandantService.GetAllTenants.
func (c *mandantServiceClient) GetAllTenants(ctx context.Context, req *v1.ListTenantRequest) (*v1.ListProjectsResponse, error) {
response, err := c.getAllTenants.CallUnary(ctx, connect.NewRequest(req))
if response != nil {
return response.Msg, err
}
return nil, err
}
// SetCurrentTenant calls mandant.v1.MandantService.SetCurrentTenant.
func (c *mandantServiceClient) SetCurrentTenant(ctx context.Context, req *v1.SetCurrentTenantRequest) (*v1.SetCurrentTenantResponse, error) {
response, err := c.setCurrentTenant.CallUnary(ctx, connect.NewRequest(req))
if response != nil {
return response.Msg, err
}
return nil, err
}
// MandantServiceHandler is an implementation of the mandant.v1.MandantService service.
type MandantServiceHandler interface {
GetCurrentTenant(context.Context, *v1.GetCurrentTenantRequest) (*v1.GetTenantResponse, error)
GetAllTenants(context.Context, *v1.ListTenantRequest) (*v1.ListProjectsResponse, error)
SetCurrentTenant(context.Context, *v1.SetCurrentTenantRequest) (*v1.SetCurrentTenantResponse, error)
}
// NewMandantServiceHandler builds an HTTP handler from the service implementation. It returns the
// path on which to mount the handler and the handler itself.
//
// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
// and JSON codecs. They also support gzip compression.
func NewMandantServiceHandler(svc MandantServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
mandantServiceMethods := v1.File_mandant_v1_mandant_proto.Services().ByName("MandantService").Methods()
mandantServiceGetCurrentTenantHandler := connect.NewUnaryHandlerSimple(
MandantServiceGetCurrentTenantProcedure,
svc.GetCurrentTenant,
connect.WithSchema(mandantServiceMethods.ByName("GetCurrentTenant")),
connect.WithHandlerOptions(opts...),
)
mandantServiceGetAllTenantsHandler := connect.NewUnaryHandlerSimple(
MandantServiceGetAllTenantsProcedure,
svc.GetAllTenants,
connect.WithSchema(mandantServiceMethods.ByName("GetAllTenants")),
connect.WithHandlerOptions(opts...),
)
mandantServiceSetCurrentTenantHandler := connect.NewUnaryHandlerSimple(
MandantServiceSetCurrentTenantProcedure,
svc.SetCurrentTenant,
connect.WithSchema(mandantServiceMethods.ByName("SetCurrentTenant")),
connect.WithHandlerOptions(opts...),
)
return "/mandant.v1.MandantService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
switch r.URL.Path {
case MandantServiceGetCurrentTenantProcedure:
mandantServiceGetCurrentTenantHandler.ServeHTTP(w, r)
case MandantServiceGetAllTenantsProcedure:
mandantServiceGetAllTenantsHandler.ServeHTTP(w, r)
case MandantServiceSetCurrentTenantProcedure:
mandantServiceSetCurrentTenantHandler.ServeHTTP(w, r)
default:
http.NotFound(w, r)
}
})
}
// UnimplementedMandantServiceHandler returns CodeUnimplemented from all methods.
type UnimplementedMandantServiceHandler struct{}
func (UnimplementedMandantServiceHandler) GetCurrentTenant(context.Context, *v1.GetCurrentTenantRequest) (*v1.GetTenantResponse, error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mandant.v1.MandantService.GetCurrentTenant is not implemented"))
}
func (UnimplementedMandantServiceHandler) GetAllTenants(context.Context, *v1.ListTenantRequest) (*v1.ListProjectsResponse, error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mandant.v1.MandantService.GetAllTenants is not implemented"))
}
func (UnimplementedMandantServiceHandler) SetCurrentTenant(context.Context, *v1.SetCurrentTenantRequest) (*v1.SetCurrentTenantResponse, error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mandant.v1.MandantService.SetCurrentTenant is not implemented"))
}

View File

@@ -0,0 +1,217 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.10
// protoc (unknown)
// source: messagebus/v1/messagebus.proto
package messagebusv1
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type MessageBusEntityType int32
const (
MessageBusEntityType_OTHER MessageBusEntityType = 0
MessageBusEntityType_INVALIDATION_REQUEST MessageBusEntityType = 1
)
// Enum value maps for MessageBusEntityType.
var (
MessageBusEntityType_name = map[int32]string{
0: "OTHER",
1: "INVALIDATION_REQUEST",
}
MessageBusEntityType_value = map[string]int32{
"OTHER": 0,
"INVALIDATION_REQUEST": 1,
}
)
func (x MessageBusEntityType) Enum() *MessageBusEntityType {
p := new(MessageBusEntityType)
*p = x
return p
}
func (x MessageBusEntityType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (MessageBusEntityType) Descriptor() protoreflect.EnumDescriptor {
return file_messagebus_v1_messagebus_proto_enumTypes[0].Descriptor()
}
func (MessageBusEntityType) Type() protoreflect.EnumType {
return &file_messagebus_v1_messagebus_proto_enumTypes[0]
}
func (x MessageBusEntityType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use MessageBusEntityType.Descriptor instead.
func (MessageBusEntityType) EnumDescriptor() ([]byte, []int) {
return file_messagebus_v1_messagebus_proto_rawDescGZIP(), []int{0}
}
type MessageBusEntity struct {
state protoimpl.MessageState `protogen:"open.v1"`
QueryKey string `protobuf:"bytes,1,opt,name=queryKey,proto3" json:"queryKey,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *MessageBusEntity) Reset() {
*x = MessageBusEntity{}
mi := &file_messagebus_v1_messagebus_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *MessageBusEntity) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MessageBusEntity) ProtoMessage() {}
func (x *MessageBusEntity) ProtoReflect() protoreflect.Message {
mi := &file_messagebus_v1_messagebus_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MessageBusEntity.ProtoReflect.Descriptor instead.
func (*MessageBusEntity) Descriptor() ([]byte, []int) {
return file_messagebus_v1_messagebus_proto_rawDescGZIP(), []int{0}
}
func (x *MessageBusEntity) GetQueryKey() string {
if x != nil {
return x.QueryKey
}
return ""
}
type SubscribeToConnectInvalidationRequestsRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *SubscribeToConnectInvalidationRequestsRequest) Reset() {
*x = SubscribeToConnectInvalidationRequestsRequest{}
mi := &file_messagebus_v1_messagebus_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *SubscribeToConnectInvalidationRequestsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SubscribeToConnectInvalidationRequestsRequest) ProtoMessage() {}
func (x *SubscribeToConnectInvalidationRequestsRequest) ProtoReflect() protoreflect.Message {
mi := &file_messagebus_v1_messagebus_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SubscribeToConnectInvalidationRequestsRequest.ProtoReflect.Descriptor instead.
func (*SubscribeToConnectInvalidationRequestsRequest) Descriptor() ([]byte, []int) {
return file_messagebus_v1_messagebus_proto_rawDescGZIP(), []int{1}
}
var File_messagebus_v1_messagebus_proto protoreflect.FileDescriptor
const file_messagebus_v1_messagebus_proto_rawDesc = "" +
"\n" +
"\x1emessagebus/v1/messagebus.proto\x12\rmessagebus.v1\".\n" +
"\x10MessageBusEntity\x12\x1a\n" +
"\bqueryKey\x18\x01 \x01(\tR\bqueryKey\"/\n" +
"-SubscribeToConnectInvalidationRequestsRequest*;\n" +
"\x14MessageBusEntityType\x12\t\n" +
"\x05OTHER\x10\x00\x12\x18\n" +
"\x14INVALIDATION_REQUEST\x10\x012\x9f\x01\n" +
"\x11MessageBusService\x12\x89\x01\n" +
"&SubscribeToConnectInvalidationRequests\x12<.messagebus.v1.SubscribeToConnectInvalidationRequestsRequest\x1a\x1f.messagebus.v1.MessageBusEntity0\x01B\xb4\x01\n" +
"\x11com.messagebus.v1B\x0fMessagebusProtoP\x01Z9git.kocoder.xyz/kocoded/vt/gen/messagebus/v1;messagebusv1\xa2\x02\x03MXX\xaa\x02\rMessagebus.V1\xca\x02\rMessagebus\\V1\xe2\x02\x19Messagebus\\V1\\GPBMetadata\xea\x02\x0eMessagebus::V1b\x06proto3"
var (
file_messagebus_v1_messagebus_proto_rawDescOnce sync.Once
file_messagebus_v1_messagebus_proto_rawDescData []byte
)
func file_messagebus_v1_messagebus_proto_rawDescGZIP() []byte {
file_messagebus_v1_messagebus_proto_rawDescOnce.Do(func() {
file_messagebus_v1_messagebus_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_messagebus_v1_messagebus_proto_rawDesc), len(file_messagebus_v1_messagebus_proto_rawDesc)))
})
return file_messagebus_v1_messagebus_proto_rawDescData
}
var file_messagebus_v1_messagebus_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_messagebus_v1_messagebus_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_messagebus_v1_messagebus_proto_goTypes = []any{
(MessageBusEntityType)(0), // 0: messagebus.v1.MessageBusEntityType
(*MessageBusEntity)(nil), // 1: messagebus.v1.MessageBusEntity
(*SubscribeToConnectInvalidationRequestsRequest)(nil), // 2: messagebus.v1.SubscribeToConnectInvalidationRequestsRequest
}
var file_messagebus_v1_messagebus_proto_depIdxs = []int32{
2, // 0: messagebus.v1.MessageBusService.SubscribeToConnectInvalidationRequests:input_type -> messagebus.v1.SubscribeToConnectInvalidationRequestsRequest
1, // 1: messagebus.v1.MessageBusService.SubscribeToConnectInvalidationRequests:output_type -> messagebus.v1.MessageBusEntity
1, // [1:2] is the sub-list for method output_type
0, // [0:1] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_messagebus_v1_messagebus_proto_init() }
func file_messagebus_v1_messagebus_proto_init() {
if File_messagebus_v1_messagebus_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_messagebus_v1_messagebus_proto_rawDesc), len(file_messagebus_v1_messagebus_proto_rawDesc)),
NumEnums: 1,
NumMessages: 2,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_messagebus_v1_messagebus_proto_goTypes,
DependencyIndexes: file_messagebus_v1_messagebus_proto_depIdxs,
EnumInfos: file_messagebus_v1_messagebus_proto_enumTypes,
MessageInfos: file_messagebus_v1_messagebus_proto_msgTypes,
}.Build()
File_messagebus_v1_messagebus_proto = out.File
file_messagebus_v1_messagebus_proto_goTypes = nil
file_messagebus_v1_messagebus_proto_depIdxs = nil
}

View File

@@ -0,0 +1,110 @@
// Code generated by protoc-gen-connect-go. DO NOT EDIT.
//
// Source: messagebus/v1/messagebus.proto
package messagebusv1connect
import (
connect "connectrpc.com/connect"
context "context"
errors "errors"
v1 "git.kocoder.xyz/kocoded/vt/gen/messagebus/v1"
http "net/http"
strings "strings"
)
// This is a compile-time assertion to ensure that this generated file and the connect package are
// compatible. If you get a compiler error that this constant is not defined, this code was
// generated with a version of connect newer than the one compiled into your binary. You can fix the
// problem by either regenerating this code with an older version of connect or updating the connect
// version compiled into your binary.
const _ = connect.IsAtLeastVersion1_13_0
const (
// MessageBusServiceName is the fully-qualified name of the MessageBusService service.
MessageBusServiceName = "messagebus.v1.MessageBusService"
)
// These constants are the fully-qualified names of the RPCs defined in this package. They're
// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
//
// Note that these are different from the fully-qualified method names used by
// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
// period.
const (
// MessageBusServiceSubscribeToConnectInvalidationRequestsProcedure is the fully-qualified name of
// the MessageBusService's SubscribeToConnectInvalidationRequests RPC.
MessageBusServiceSubscribeToConnectInvalidationRequestsProcedure = "/messagebus.v1.MessageBusService/SubscribeToConnectInvalidationRequests"
)
// MessageBusServiceClient is a client for the messagebus.v1.MessageBusService service.
type MessageBusServiceClient interface {
SubscribeToConnectInvalidationRequests(context.Context, *v1.SubscribeToConnectInvalidationRequestsRequest) (*connect.ServerStreamForClient[v1.MessageBusEntity], error)
}
// NewMessageBusServiceClient constructs a client for the messagebus.v1.MessageBusService service.
// By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped
// responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the
// connect.WithGRPC() or connect.WithGRPCWeb() options.
//
// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
// http://api.acme.com or https://acme.com/grpc).
func NewMessageBusServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) MessageBusServiceClient {
baseURL = strings.TrimRight(baseURL, "/")
messageBusServiceMethods := v1.File_messagebus_v1_messagebus_proto.Services().ByName("MessageBusService").Methods()
return &messageBusServiceClient{
subscribeToConnectInvalidationRequests: connect.NewClient[v1.SubscribeToConnectInvalidationRequestsRequest, v1.MessageBusEntity](
httpClient,
baseURL+MessageBusServiceSubscribeToConnectInvalidationRequestsProcedure,
connect.WithSchema(messageBusServiceMethods.ByName("SubscribeToConnectInvalidationRequests")),
connect.WithClientOptions(opts...),
),
}
}
// messageBusServiceClient implements MessageBusServiceClient.
type messageBusServiceClient struct {
subscribeToConnectInvalidationRequests *connect.Client[v1.SubscribeToConnectInvalidationRequestsRequest, v1.MessageBusEntity]
}
// SubscribeToConnectInvalidationRequests calls
// messagebus.v1.MessageBusService.SubscribeToConnectInvalidationRequests.
func (c *messageBusServiceClient) SubscribeToConnectInvalidationRequests(ctx context.Context, req *v1.SubscribeToConnectInvalidationRequestsRequest) (*connect.ServerStreamForClient[v1.MessageBusEntity], error) {
return c.subscribeToConnectInvalidationRequests.CallServerStream(ctx, connect.NewRequest(req))
}
// MessageBusServiceHandler is an implementation of the messagebus.v1.MessageBusService service.
type MessageBusServiceHandler interface {
SubscribeToConnectInvalidationRequests(context.Context, *v1.SubscribeToConnectInvalidationRequestsRequest, *connect.ServerStream[v1.MessageBusEntity]) error
}
// NewMessageBusServiceHandler builds an HTTP handler from the service implementation. It returns
// the path on which to mount the handler and the handler itself.
//
// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
// and JSON codecs. They also support gzip compression.
func NewMessageBusServiceHandler(svc MessageBusServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
messageBusServiceMethods := v1.File_messagebus_v1_messagebus_proto.Services().ByName("MessageBusService").Methods()
messageBusServiceSubscribeToConnectInvalidationRequestsHandler := connect.NewServerStreamHandlerSimple(
MessageBusServiceSubscribeToConnectInvalidationRequestsProcedure,
svc.SubscribeToConnectInvalidationRequests,
connect.WithSchema(messageBusServiceMethods.ByName("SubscribeToConnectInvalidationRequests")),
connect.WithHandlerOptions(opts...),
)
return "/messagebus.v1.MessageBusService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
switch r.URL.Path {
case MessageBusServiceSubscribeToConnectInvalidationRequestsProcedure:
messageBusServiceSubscribeToConnectInvalidationRequestsHandler.ServeHTTP(w, r)
default:
http.NotFound(w, r)
}
})
}
// UnimplementedMessageBusServiceHandler returns CodeUnimplemented from all methods.
type UnimplementedMessageBusServiceHandler struct{}
func (UnimplementedMessageBusServiceHandler) SubscribeToConnectInvalidationRequests(context.Context, *v1.SubscribeToConnectInvalidationRequestsRequest, *connect.ServerStream[v1.MessageBusEntity]) error {
return connect.NewError(connect.CodeUnimplemented, errors.New("messagebus.v1.MessageBusService.SubscribeToConnectInvalidationRequests is not implemented"))
}

View File

@@ -0,0 +1,433 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.10
// protoc (unknown)
// source: project/v1/project.proto
package projectv1
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type GetProjectRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GetProjectRequest) Reset() {
*x = GetProjectRequest{}
mi := &file_project_v1_project_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *GetProjectRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetProjectRequest) ProtoMessage() {}
func (x *GetProjectRequest) ProtoReflect() protoreflect.Message {
mi := &file_project_v1_project_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetProjectRequest.ProtoReflect.Descriptor instead.
func (*GetProjectRequest) Descriptor() ([]byte, []int) {
return file_project_v1_project_proto_rawDescGZIP(), []int{0}
}
func (x *GetProjectRequest) GetId() int32 {
if x != nil {
return x.Id
}
return 0
}
type GetProjectResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
IsMaterialized *bool `protobuf:"varint,5,opt,name=is_materialized,json=isMaterialized,proto3,oneof" json:"is_materialized,omitempty"`
IsPersonalized *bool `protobuf:"varint,6,opt,name=is_personalized,json=isPersonalized,proto3,oneof" json:"is_personalized,omitempty"`
IsConfirmed *bool `protobuf:"varint,7,opt,name=is_confirmed,json=isConfirmed,proto3,oneof" json:"is_confirmed,omitempty"`
IsPaid *bool `protobuf:"varint,8,opt,name=is_paid,json=isPaid,proto3,oneof" json:"is_paid,omitempty"`
IsDone *bool `protobuf:"varint,9,opt,name=is_done,json=isDone,proto3,oneof" json:"is_done,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GetProjectResponse) Reset() {
*x = GetProjectResponse{}
mi := &file_project_v1_project_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *GetProjectResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetProjectResponse) ProtoMessage() {}
func (x *GetProjectResponse) ProtoReflect() protoreflect.Message {
mi := &file_project_v1_project_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetProjectResponse.ProtoReflect.Descriptor instead.
func (*GetProjectResponse) Descriptor() ([]byte, []int) {
return file_project_v1_project_proto_rawDescGZIP(), []int{1}
}
func (x *GetProjectResponse) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *GetProjectResponse) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *GetProjectResponse) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
func (x *GetProjectResponse) GetIsMaterialized() bool {
if x != nil && x.IsMaterialized != nil {
return *x.IsMaterialized
}
return false
}
func (x *GetProjectResponse) GetIsPersonalized() bool {
if x != nil && x.IsPersonalized != nil {
return *x.IsPersonalized
}
return false
}
func (x *GetProjectResponse) GetIsConfirmed() bool {
if x != nil && x.IsConfirmed != nil {
return *x.IsConfirmed
}
return false
}
func (x *GetProjectResponse) GetIsPaid() bool {
if x != nil && x.IsPaid != nil {
return *x.IsPaid
}
return false
}
func (x *GetProjectResponse) GetIsDone() bool {
if x != nil && x.IsDone != nil {
return *x.IsDone
}
return false
}
type ListProjectsRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
PerPage int32 `protobuf:"varint,2,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"`
OrberBy string `protobuf:"bytes,3,opt,name=orber_by,json=orberBy,proto3" json:"orber_by,omitempty"`
Asc bool `protobuf:"varint,4,opt,name=asc,proto3" json:"asc,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ListProjectsRequest) Reset() {
*x = ListProjectsRequest{}
mi := &file_project_v1_project_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ListProjectsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListProjectsRequest) ProtoMessage() {}
func (x *ListProjectsRequest) ProtoReflect() protoreflect.Message {
mi := &file_project_v1_project_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListProjectsRequest.ProtoReflect.Descriptor instead.
func (*ListProjectsRequest) Descriptor() ([]byte, []int) {
return file_project_v1_project_proto_rawDescGZIP(), []int{2}
}
func (x *ListProjectsRequest) GetPage() int32 {
if x != nil {
return x.Page
}
return 0
}
func (x *ListProjectsRequest) GetPerPage() int32 {
if x != nil {
return x.PerPage
}
return 0
}
func (x *ListProjectsRequest) GetOrberBy() string {
if x != nil {
return x.OrberBy
}
return ""
}
func (x *ListProjectsRequest) GetAsc() bool {
if x != nil {
return x.Asc
}
return false
}
type Metadata struct {
state protoimpl.MessageState `protogen:"open.v1"`
TotalCount int32 `protobuf:"varint,1,opt,name=totalCount,proto3" json:"totalCount,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Metadata) Reset() {
*x = Metadata{}
mi := &file_project_v1_project_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Metadata) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Metadata) ProtoMessage() {}
func (x *Metadata) ProtoReflect() protoreflect.Message {
mi := &file_project_v1_project_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Metadata.ProtoReflect.Descriptor instead.
func (*Metadata) Descriptor() ([]byte, []int) {
return file_project_v1_project_proto_rawDescGZIP(), []int{3}
}
func (x *Metadata) GetTotalCount() int32 {
if x != nil {
return x.TotalCount
}
return 0
}
type ListProjectsResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Data []*GetProjectResponse `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"`
Meta *Metadata `protobuf:"bytes,2,opt,name=meta,proto3" json:"meta,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ListProjectsResponse) Reset() {
*x = ListProjectsResponse{}
mi := &file_project_v1_project_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ListProjectsResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListProjectsResponse) ProtoMessage() {}
func (x *ListProjectsResponse) ProtoReflect() protoreflect.Message {
mi := &file_project_v1_project_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListProjectsResponse.ProtoReflect.Descriptor instead.
func (*ListProjectsResponse) Descriptor() ([]byte, []int) {
return file_project_v1_project_proto_rawDescGZIP(), []int{4}
}
func (x *ListProjectsResponse) GetData() []*GetProjectResponse {
if x != nil {
return x.Data
}
return nil
}
func (x *ListProjectsResponse) GetMeta() *Metadata {
if x != nil {
return x.Meta
}
return nil
}
var File_project_v1_project_proto protoreflect.FileDescriptor
const file_project_v1_project_proto_rawDesc = "" +
"\n" +
"\x18project/v1/project.proto\x12\n" +
"project.v1\"#\n" +
"\x11GetProjectRequest\x12\x0e\n" +
"\x02id\x18\x01 \x01(\x05R\x02id\"\xeb\x02\n" +
"\x12GetProjectResponse\x12\x0e\n" +
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x12\n" +
"\x04name\x18\x02 \x01(\tR\x04name\x12 \n" +
"\vdescription\x18\x03 \x01(\tR\vdescription\x12,\n" +
"\x0fis_materialized\x18\x05 \x01(\bH\x00R\x0eisMaterialized\x88\x01\x01\x12,\n" +
"\x0fis_personalized\x18\x06 \x01(\bH\x01R\x0eisPersonalized\x88\x01\x01\x12&\n" +
"\fis_confirmed\x18\a \x01(\bH\x02R\visConfirmed\x88\x01\x01\x12\x1c\n" +
"\ais_paid\x18\b \x01(\bH\x03R\x06isPaid\x88\x01\x01\x12\x1c\n" +
"\ais_done\x18\t \x01(\bH\x04R\x06isDone\x88\x01\x01B\x12\n" +
"\x10_is_materializedB\x12\n" +
"\x10_is_personalizedB\x0f\n" +
"\r_is_confirmedB\n" +
"\n" +
"\b_is_paidB\n" +
"\n" +
"\b_is_done\"q\n" +
"\x13ListProjectsRequest\x12\x12\n" +
"\x04page\x18\x01 \x01(\x05R\x04page\x12\x19\n" +
"\bper_page\x18\x02 \x01(\x05R\aperPage\x12\x19\n" +
"\borber_by\x18\x03 \x01(\tR\aorberBy\x12\x10\n" +
"\x03asc\x18\x04 \x01(\bR\x03asc\"*\n" +
"\bMetadata\x12\x1e\n" +
"\n" +
"totalCount\x18\x01 \x01(\x05R\n" +
"totalCount\"t\n" +
"\x14ListProjectsResponse\x122\n" +
"\x04data\x18\x01 \x03(\v2\x1e.project.v1.GetProjectResponseR\x04data\x12(\n" +
"\x04meta\x18\x02 \x01(\v2\x14.project.v1.MetadataR\x04meta2\xb0\x01\n" +
"\x0eProjectService\x12K\n" +
"\n" +
"GetProject\x12\x1d.project.v1.GetProjectRequest\x1a\x1e.project.v1.GetProjectResponse\x12Q\n" +
"\fListProjects\x12\x1f.project.v1.ListProjectsRequest\x1a .project.v1.ListProjectsResponseB\x9c\x01\n" +
"\x0ecom.project.v1B\fProjectProtoP\x01Z3git.kocoder.xyz/kocoded/vt/gen/project/v1;projectv1\xa2\x02\x03PXX\xaa\x02\n" +
"Project.V1\xca\x02\n" +
"Project\\V1\xe2\x02\x16Project\\V1\\GPBMetadata\xea\x02\vProject::V1b\x06proto3"
var (
file_project_v1_project_proto_rawDescOnce sync.Once
file_project_v1_project_proto_rawDescData []byte
)
func file_project_v1_project_proto_rawDescGZIP() []byte {
file_project_v1_project_proto_rawDescOnce.Do(func() {
file_project_v1_project_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_project_v1_project_proto_rawDesc), len(file_project_v1_project_proto_rawDesc)))
})
return file_project_v1_project_proto_rawDescData
}
var file_project_v1_project_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_project_v1_project_proto_goTypes = []any{
(*GetProjectRequest)(nil), // 0: project.v1.GetProjectRequest
(*GetProjectResponse)(nil), // 1: project.v1.GetProjectResponse
(*ListProjectsRequest)(nil), // 2: project.v1.ListProjectsRequest
(*Metadata)(nil), // 3: project.v1.Metadata
(*ListProjectsResponse)(nil), // 4: project.v1.ListProjectsResponse
}
var file_project_v1_project_proto_depIdxs = []int32{
1, // 0: project.v1.ListProjectsResponse.data:type_name -> project.v1.GetProjectResponse
3, // 1: project.v1.ListProjectsResponse.meta:type_name -> project.v1.Metadata
0, // 2: project.v1.ProjectService.GetProject:input_type -> project.v1.GetProjectRequest
2, // 3: project.v1.ProjectService.ListProjects:input_type -> project.v1.ListProjectsRequest
1, // 4: project.v1.ProjectService.GetProject:output_type -> project.v1.GetProjectResponse
4, // 5: project.v1.ProjectService.ListProjects:output_type -> project.v1.ListProjectsResponse
4, // [4:6] is the sub-list for method output_type
2, // [2:4] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_project_v1_project_proto_init() }
func file_project_v1_project_proto_init() {
if File_project_v1_project_proto != nil {
return
}
file_project_v1_project_proto_msgTypes[1].OneofWrappers = []any{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_project_v1_project_proto_rawDesc), len(file_project_v1_project_proto_rawDesc)),
NumEnums: 0,
NumMessages: 5,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_project_v1_project_proto_goTypes,
DependencyIndexes: file_project_v1_project_proto_depIdxs,
MessageInfos: file_project_v1_project_proto_msgTypes,
}.Build()
File_project_v1_project_proto = out.File
file_project_v1_project_proto_goTypes = nil
file_project_v1_project_proto_depIdxs = nil
}

View File

@@ -0,0 +1,146 @@
// Code generated by protoc-gen-connect-go. DO NOT EDIT.
//
// Source: project/v1/project.proto
package projectv1connect
import (
connect "connectrpc.com/connect"
context "context"
errors "errors"
v1 "git.kocoder.xyz/kocoded/vt/gen/project/v1"
http "net/http"
strings "strings"
)
// This is a compile-time assertion to ensure that this generated file and the connect package are
// compatible. If you get a compiler error that this constant is not defined, this code was
// generated with a version of connect newer than the one compiled into your binary. You can fix the
// problem by either regenerating this code with an older version of connect or updating the connect
// version compiled into your binary.
const _ = connect.IsAtLeastVersion1_13_0
const (
// ProjectServiceName is the fully-qualified name of the ProjectService service.
ProjectServiceName = "project.v1.ProjectService"
)
// These constants are the fully-qualified names of the RPCs defined in this package. They're
// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
//
// Note that these are different from the fully-qualified method names used by
// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
// period.
const (
// ProjectServiceGetProjectProcedure is the fully-qualified name of the ProjectService's GetProject
// RPC.
ProjectServiceGetProjectProcedure = "/project.v1.ProjectService/GetProject"
// ProjectServiceListProjectsProcedure is the fully-qualified name of the ProjectService's
// ListProjects RPC.
ProjectServiceListProjectsProcedure = "/project.v1.ProjectService/ListProjects"
)
// ProjectServiceClient is a client for the project.v1.ProjectService service.
type ProjectServiceClient interface {
GetProject(context.Context, *v1.GetProjectRequest) (*v1.GetProjectResponse, error)
ListProjects(context.Context, *v1.ListProjectsRequest) (*v1.ListProjectsResponse, error)
}
// NewProjectServiceClient constructs a client for the project.v1.ProjectService service. By
// default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses,
// and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the
// connect.WithGRPC() or connect.WithGRPCWeb() options.
//
// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
// http://api.acme.com or https://acme.com/grpc).
func NewProjectServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ProjectServiceClient {
baseURL = strings.TrimRight(baseURL, "/")
projectServiceMethods := v1.File_project_v1_project_proto.Services().ByName("ProjectService").Methods()
return &projectServiceClient{
getProject: connect.NewClient[v1.GetProjectRequest, v1.GetProjectResponse](
httpClient,
baseURL+ProjectServiceGetProjectProcedure,
connect.WithSchema(projectServiceMethods.ByName("GetProject")),
connect.WithClientOptions(opts...),
),
listProjects: connect.NewClient[v1.ListProjectsRequest, v1.ListProjectsResponse](
httpClient,
baseURL+ProjectServiceListProjectsProcedure,
connect.WithSchema(projectServiceMethods.ByName("ListProjects")),
connect.WithClientOptions(opts...),
),
}
}
// projectServiceClient implements ProjectServiceClient.
type projectServiceClient struct {
getProject *connect.Client[v1.GetProjectRequest, v1.GetProjectResponse]
listProjects *connect.Client[v1.ListProjectsRequest, v1.ListProjectsResponse]
}
// GetProject calls project.v1.ProjectService.GetProject.
func (c *projectServiceClient) GetProject(ctx context.Context, req *v1.GetProjectRequest) (*v1.GetProjectResponse, error) {
response, err := c.getProject.CallUnary(ctx, connect.NewRequest(req))
if response != nil {
return response.Msg, err
}
return nil, err
}
// ListProjects calls project.v1.ProjectService.ListProjects.
func (c *projectServiceClient) ListProjects(ctx context.Context, req *v1.ListProjectsRequest) (*v1.ListProjectsResponse, error) {
response, err := c.listProjects.CallUnary(ctx, connect.NewRequest(req))
if response != nil {
return response.Msg, err
}
return nil, err
}
// ProjectServiceHandler is an implementation of the project.v1.ProjectService service.
type ProjectServiceHandler interface {
GetProject(context.Context, *v1.GetProjectRequest) (*v1.GetProjectResponse, error)
ListProjects(context.Context, *v1.ListProjectsRequest) (*v1.ListProjectsResponse, error)
}
// NewProjectServiceHandler builds an HTTP handler from the service implementation. It returns the
// path on which to mount the handler and the handler itself.
//
// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
// and JSON codecs. They also support gzip compression.
func NewProjectServiceHandler(svc ProjectServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
projectServiceMethods := v1.File_project_v1_project_proto.Services().ByName("ProjectService").Methods()
projectServiceGetProjectHandler := connect.NewUnaryHandlerSimple(
ProjectServiceGetProjectProcedure,
svc.GetProject,
connect.WithSchema(projectServiceMethods.ByName("GetProject")),
connect.WithHandlerOptions(opts...),
)
projectServiceListProjectsHandler := connect.NewUnaryHandlerSimple(
ProjectServiceListProjectsProcedure,
svc.ListProjects,
connect.WithSchema(projectServiceMethods.ByName("ListProjects")),
connect.WithHandlerOptions(opts...),
)
return "/project.v1.ProjectService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
switch r.URL.Path {
case ProjectServiceGetProjectProcedure:
projectServiceGetProjectHandler.ServeHTTP(w, r)
case ProjectServiceListProjectsProcedure:
projectServiceListProjectsHandler.ServeHTTP(w, r)
default:
http.NotFound(w, r)
}
})
}
// UnimplementedProjectServiceHandler returns CodeUnimplemented from all methods.
type UnimplementedProjectServiceHandler struct{}
func (UnimplementedProjectServiceHandler) GetProject(context.Context, *v1.GetProjectRequest) (*v1.GetProjectResponse, error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("project.v1.ProjectService.GetProject is not implemented"))
}
func (UnimplementedProjectServiceHandler) ListProjects(context.Context, *v1.ListProjectsRequest) (*v1.ListProjectsResponse, error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("project.v1.ProjectService.ListProjects is not implemented"))
}

645
gen/todo/v1/todo.pb.go Normal file
View File

@@ -0,0 +1,645 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.10
// protoc (unknown)
// source: todo/v1/todo.proto
package todov1
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type Status int32
const (
Status_Todo Status = 0
Status_NeedsMoreInfo Status = 1
Status_Doing Status = 2
Status_Done Status = 3
)
// Enum value maps for Status.
var (
Status_name = map[int32]string{
0: "Todo",
1: "NeedsMoreInfo",
2: "Doing",
3: "Done",
}
Status_value = map[string]int32{
"Todo": 0,
"NeedsMoreInfo": 1,
"Doing": 2,
"Done": 3,
}
)
func (x Status) Enum() *Status {
p := new(Status)
*p = x
return p
}
func (x Status) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (Status) Descriptor() protoreflect.EnumDescriptor {
return file_todo_v1_todo_proto_enumTypes[0].Descriptor()
}
func (Status) Type() protoreflect.EnumType {
return &file_todo_v1_todo_proto_enumTypes[0]
}
func (x Status) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use Status.Descriptor instead.
func (Status) EnumDescriptor() ([]byte, []int) {
return file_todo_v1_todo_proto_rawDescGZIP(), []int{0}
}
type Field int32
const (
Field_FieldId Field = 0
Field_FieldTitle Field = 1
Field_FieldDescription Field = 2
Field_FieldStatus Field = 3
)
// Enum value maps for Field.
var (
Field_name = map[int32]string{
0: "FieldId",
1: "FieldTitle",
2: "FieldDescription",
3: "FieldStatus",
}
Field_value = map[string]int32{
"FieldId": 0,
"FieldTitle": 1,
"FieldDescription": 2,
"FieldStatus": 3,
}
)
func (x Field) Enum() *Field {
p := new(Field)
*p = x
return p
}
func (x Field) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (Field) Descriptor() protoreflect.EnumDescriptor {
return file_todo_v1_todo_proto_enumTypes[1].Descriptor()
}
func (Field) Type() protoreflect.EnumType {
return &file_todo_v1_todo_proto_enumTypes[1]
}
func (x Field) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use Field.Descriptor instead.
func (Field) EnumDescriptor() ([]byte, []int) {
return file_todo_v1_todo_proto_rawDescGZIP(), []int{1}
}
type Operation int32
const (
Operation_Equals Operation = 0
Operation_NotEquals Operation = 1
Operation_GreaterThan Operation = 2
Operation_LessThan Operation = 3
Operation_Like Operation = 4
)
// Enum value maps for Operation.
var (
Operation_name = map[int32]string{
0: "Equals",
1: "NotEquals",
2: "GreaterThan",
3: "LessThan",
4: "Like",
}
Operation_value = map[string]int32{
"Equals": 0,
"NotEquals": 1,
"GreaterThan": 2,
"LessThan": 3,
"Like": 4,
}
)
func (x Operation) Enum() *Operation {
p := new(Operation)
*p = x
return p
}
func (x Operation) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (Operation) Descriptor() protoreflect.EnumDescriptor {
return file_todo_v1_todo_proto_enumTypes[2].Descriptor()
}
func (Operation) Type() protoreflect.EnumType {
return &file_todo_v1_todo_proto_enumTypes[2]
}
func (x Operation) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use Operation.Descriptor instead.
func (Operation) EnumDescriptor() ([]byte, []int) {
return file_todo_v1_todo_proto_rawDescGZIP(), []int{2}
}
type GetTodosRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GetTodosRequest) Reset() {
*x = GetTodosRequest{}
mi := &file_todo_v1_todo_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *GetTodosRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetTodosRequest) ProtoMessage() {}
func (x *GetTodosRequest) ProtoReflect() protoreflect.Message {
mi := &file_todo_v1_todo_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetTodosRequest.ProtoReflect.Descriptor instead.
func (*GetTodosRequest) Descriptor() ([]byte, []int) {
return file_todo_v1_todo_proto_rawDescGZIP(), []int{0}
}
func (x *GetTodosRequest) GetId() int32 {
if x != nil {
return x.Id
}
return 0
}
type GetTodosResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
Status Status `protobuf:"varint,4,opt,name=status,proto3,enum=todo.v1.Status" json:"status,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GetTodosResponse) Reset() {
*x = GetTodosResponse{}
mi := &file_todo_v1_todo_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *GetTodosResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetTodosResponse) ProtoMessage() {}
func (x *GetTodosResponse) ProtoReflect() protoreflect.Message {
mi := &file_todo_v1_todo_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetTodosResponse.ProtoReflect.Descriptor instead.
func (*GetTodosResponse) Descriptor() ([]byte, []int) {
return file_todo_v1_todo_proto_rawDescGZIP(), []int{1}
}
func (x *GetTodosResponse) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *GetTodosResponse) GetTitle() string {
if x != nil {
return x.Title
}
return ""
}
func (x *GetTodosResponse) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
func (x *GetTodosResponse) GetStatus() Status {
if x != nil {
return x.Status
}
return Status_Todo
}
type ListTodosRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
PerPage int32 `protobuf:"varint,2,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"`
OrberBy string `protobuf:"bytes,3,opt,name=orber_by,json=orberBy,proto3" json:"orber_by,omitempty"`
Asc bool `protobuf:"varint,4,opt,name=asc,proto3" json:"asc,omitempty"`
Filters []*Filter `protobuf:"bytes,5,rep,name=filters,proto3" json:"filters,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ListTodosRequest) Reset() {
*x = ListTodosRequest{}
mi := &file_todo_v1_todo_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ListTodosRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListTodosRequest) ProtoMessage() {}
func (x *ListTodosRequest) ProtoReflect() protoreflect.Message {
mi := &file_todo_v1_todo_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListTodosRequest.ProtoReflect.Descriptor instead.
func (*ListTodosRequest) Descriptor() ([]byte, []int) {
return file_todo_v1_todo_proto_rawDescGZIP(), []int{2}
}
func (x *ListTodosRequest) GetPage() int32 {
if x != nil {
return x.Page
}
return 0
}
func (x *ListTodosRequest) GetPerPage() int32 {
if x != nil {
return x.PerPage
}
return 0
}
func (x *ListTodosRequest) GetOrberBy() string {
if x != nil {
return x.OrberBy
}
return ""
}
func (x *ListTodosRequest) GetAsc() bool {
if x != nil {
return x.Asc
}
return false
}
func (x *ListTodosRequest) GetFilters() []*Filter {
if x != nil {
return x.Filters
}
return nil
}
type Filter struct {
state protoimpl.MessageState `protogen:"open.v1"`
Field Field `protobuf:"varint,1,opt,name=field,proto3,enum=todo.v1.Field" json:"field,omitempty"`
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
Operation Operation `protobuf:"varint,3,opt,name=operation,proto3,enum=todo.v1.Operation" json:"operation,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Filter) Reset() {
*x = Filter{}
mi := &file_todo_v1_todo_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Filter) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Filter) ProtoMessage() {}
func (x *Filter) ProtoReflect() protoreflect.Message {
mi := &file_todo_v1_todo_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Filter.ProtoReflect.Descriptor instead.
func (*Filter) Descriptor() ([]byte, []int) {
return file_todo_v1_todo_proto_rawDescGZIP(), []int{3}
}
func (x *Filter) GetField() Field {
if x != nil {
return x.Field
}
return Field_FieldId
}
func (x *Filter) GetValue() string {
if x != nil {
return x.Value
}
return ""
}
func (x *Filter) GetOperation() Operation {
if x != nil {
return x.Operation
}
return Operation_Equals
}
type Metadata struct {
state protoimpl.MessageState `protogen:"open.v1"`
TotalCount int32 `protobuf:"varint,1,opt,name=totalCount,proto3" json:"totalCount,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Metadata) Reset() {
*x = Metadata{}
mi := &file_todo_v1_todo_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Metadata) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Metadata) ProtoMessage() {}
func (x *Metadata) ProtoReflect() protoreflect.Message {
mi := &file_todo_v1_todo_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Metadata.ProtoReflect.Descriptor instead.
func (*Metadata) Descriptor() ([]byte, []int) {
return file_todo_v1_todo_proto_rawDescGZIP(), []int{4}
}
func (x *Metadata) GetTotalCount() int32 {
if x != nil {
return x.TotalCount
}
return 0
}
type ListTodosResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Data []*GetTodosResponse `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"`
Meta *Metadata `protobuf:"bytes,2,opt,name=meta,proto3" json:"meta,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ListTodosResponse) Reset() {
*x = ListTodosResponse{}
mi := &file_todo_v1_todo_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ListTodosResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListTodosResponse) ProtoMessage() {}
func (x *ListTodosResponse) ProtoReflect() protoreflect.Message {
mi := &file_todo_v1_todo_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListTodosResponse.ProtoReflect.Descriptor instead.
func (*ListTodosResponse) Descriptor() ([]byte, []int) {
return file_todo_v1_todo_proto_rawDescGZIP(), []int{5}
}
func (x *ListTodosResponse) GetData() []*GetTodosResponse {
if x != nil {
return x.Data
}
return nil
}
func (x *ListTodosResponse) GetMeta() *Metadata {
if x != nil {
return x.Meta
}
return nil
}
var File_todo_v1_todo_proto protoreflect.FileDescriptor
const file_todo_v1_todo_proto_rawDesc = "" +
"\n" +
"\x12todo/v1/todo.proto\x12\atodo.v1\"!\n" +
"\x0fGetTodosRequest\x12\x0e\n" +
"\x02id\x18\x01 \x01(\x05R\x02id\"\x83\x01\n" +
"\x10GetTodosResponse\x12\x0e\n" +
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x14\n" +
"\x05title\x18\x02 \x01(\tR\x05title\x12 \n" +
"\vdescription\x18\x03 \x01(\tR\vdescription\x12'\n" +
"\x06status\x18\x04 \x01(\x0e2\x0f.todo.v1.StatusR\x06status\"\x99\x01\n" +
"\x10ListTodosRequest\x12\x12\n" +
"\x04page\x18\x01 \x01(\x05R\x04page\x12\x19\n" +
"\bper_page\x18\x02 \x01(\x05R\aperPage\x12\x19\n" +
"\borber_by\x18\x03 \x01(\tR\aorberBy\x12\x10\n" +
"\x03asc\x18\x04 \x01(\bR\x03asc\x12)\n" +
"\afilters\x18\x05 \x03(\v2\x0f.todo.v1.FilterR\afilters\"v\n" +
"\x06Filter\x12$\n" +
"\x05field\x18\x01 \x01(\x0e2\x0e.todo.v1.FieldR\x05field\x12\x14\n" +
"\x05value\x18\x02 \x01(\tR\x05value\x120\n" +
"\toperation\x18\x03 \x01(\x0e2\x12.todo.v1.OperationR\toperation\"*\n" +
"\bMetadata\x12\x1e\n" +
"\n" +
"totalCount\x18\x01 \x01(\x05R\n" +
"totalCount\"i\n" +
"\x11ListTodosResponse\x12-\n" +
"\x04data\x18\x01 \x03(\v2\x19.todo.v1.GetTodosResponseR\x04data\x12%\n" +
"\x04meta\x18\x02 \x01(\v2\x11.todo.v1.MetadataR\x04meta*:\n" +
"\x06Status\x12\b\n" +
"\x04Todo\x10\x00\x12\x11\n" +
"\rNeedsMoreInfo\x10\x01\x12\t\n" +
"\x05Doing\x10\x02\x12\b\n" +
"\x04Done\x10\x03*K\n" +
"\x05Field\x12\v\n" +
"\aFieldId\x10\x00\x12\x0e\n" +
"\n" +
"FieldTitle\x10\x01\x12\x14\n" +
"\x10FieldDescription\x10\x02\x12\x0f\n" +
"\vFieldStatus\x10\x03*O\n" +
"\tOperation\x12\n" +
"\n" +
"\x06Equals\x10\x00\x12\r\n" +
"\tNotEquals\x10\x01\x12\x0f\n" +
"\vGreaterThan\x10\x02\x12\f\n" +
"\bLessThan\x10\x03\x12\b\n" +
"\x04Like\x10\x042\x91\x01\n" +
"\vTodoService\x12>\n" +
"\aGetTodo\x12\x18.todo.v1.GetTodosRequest\x1a\x19.todo.v1.GetTodosResponse\x12B\n" +
"\tListTodos\x12\x19.todo.v1.ListTodosRequest\x1a\x1a.todo.v1.ListTodosResponseB\x84\x01\n" +
"\vcom.todo.v1B\tTodoProtoP\x01Z-git.kocoder.xyz/kocoded/vt/gen/todo/v1;todov1\xa2\x02\x03TXX\xaa\x02\aTodo.V1\xca\x02\aTodo\\V1\xe2\x02\x13Todo\\V1\\GPBMetadata\xea\x02\bTodo::V1b\x06proto3"
var (
file_todo_v1_todo_proto_rawDescOnce sync.Once
file_todo_v1_todo_proto_rawDescData []byte
)
func file_todo_v1_todo_proto_rawDescGZIP() []byte {
file_todo_v1_todo_proto_rawDescOnce.Do(func() {
file_todo_v1_todo_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_todo_v1_todo_proto_rawDesc), len(file_todo_v1_todo_proto_rawDesc)))
})
return file_todo_v1_todo_proto_rawDescData
}
var file_todo_v1_todo_proto_enumTypes = make([]protoimpl.EnumInfo, 3)
var file_todo_v1_todo_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_todo_v1_todo_proto_goTypes = []any{
(Status)(0), // 0: todo.v1.Status
(Field)(0), // 1: todo.v1.Field
(Operation)(0), // 2: todo.v1.Operation
(*GetTodosRequest)(nil), // 3: todo.v1.GetTodosRequest
(*GetTodosResponse)(nil), // 4: todo.v1.GetTodosResponse
(*ListTodosRequest)(nil), // 5: todo.v1.ListTodosRequest
(*Filter)(nil), // 6: todo.v1.Filter
(*Metadata)(nil), // 7: todo.v1.Metadata
(*ListTodosResponse)(nil), // 8: todo.v1.ListTodosResponse
}
var file_todo_v1_todo_proto_depIdxs = []int32{
0, // 0: todo.v1.GetTodosResponse.status:type_name -> todo.v1.Status
6, // 1: todo.v1.ListTodosRequest.filters:type_name -> todo.v1.Filter
1, // 2: todo.v1.Filter.field:type_name -> todo.v1.Field
2, // 3: todo.v1.Filter.operation:type_name -> todo.v1.Operation
4, // 4: todo.v1.ListTodosResponse.data:type_name -> todo.v1.GetTodosResponse
7, // 5: todo.v1.ListTodosResponse.meta:type_name -> todo.v1.Metadata
3, // 6: todo.v1.TodoService.GetTodo:input_type -> todo.v1.GetTodosRequest
5, // 7: todo.v1.TodoService.ListTodos:input_type -> todo.v1.ListTodosRequest
4, // 8: todo.v1.TodoService.GetTodo:output_type -> todo.v1.GetTodosResponse
8, // 9: todo.v1.TodoService.ListTodos:output_type -> todo.v1.ListTodosResponse
8, // [8:10] is the sub-list for method output_type
6, // [6:8] is the sub-list for method input_type
6, // [6:6] is the sub-list for extension type_name
6, // [6:6] is the sub-list for extension extendee
0, // [0:6] is the sub-list for field type_name
}
func init() { file_todo_v1_todo_proto_init() }
func file_todo_v1_todo_proto_init() {
if File_todo_v1_todo_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_todo_v1_todo_proto_rawDesc), len(file_todo_v1_todo_proto_rawDesc)),
NumEnums: 3,
NumMessages: 6,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_todo_v1_todo_proto_goTypes,
DependencyIndexes: file_todo_v1_todo_proto_depIdxs,
EnumInfos: file_todo_v1_todo_proto_enumTypes,
MessageInfos: file_todo_v1_todo_proto_msgTypes,
}.Build()
File_todo_v1_todo_proto = out.File
file_todo_v1_todo_proto_goTypes = nil
file_todo_v1_todo_proto_depIdxs = nil
}

View File

@@ -0,0 +1,144 @@
// Code generated by protoc-gen-connect-go. DO NOT EDIT.
//
// Source: todo/v1/todo.proto
package todov1connect
import (
connect "connectrpc.com/connect"
context "context"
errors "errors"
v1 "git.kocoder.xyz/kocoded/vt/gen/todo/v1"
http "net/http"
strings "strings"
)
// This is a compile-time assertion to ensure that this generated file and the connect package are
// compatible. If you get a compiler error that this constant is not defined, this code was
// generated with a version of connect newer than the one compiled into your binary. You can fix the
// problem by either regenerating this code with an older version of connect or updating the connect
// version compiled into your binary.
const _ = connect.IsAtLeastVersion1_13_0
const (
// TodoServiceName is the fully-qualified name of the TodoService service.
TodoServiceName = "todo.v1.TodoService"
)
// These constants are the fully-qualified names of the RPCs defined in this package. They're
// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
//
// Note that these are different from the fully-qualified method names used by
// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
// period.
const (
// TodoServiceGetTodoProcedure is the fully-qualified name of the TodoService's GetTodo RPC.
TodoServiceGetTodoProcedure = "/todo.v1.TodoService/GetTodo"
// TodoServiceListTodosProcedure is the fully-qualified name of the TodoService's ListTodos RPC.
TodoServiceListTodosProcedure = "/todo.v1.TodoService/ListTodos"
)
// TodoServiceClient is a client for the todo.v1.TodoService service.
type TodoServiceClient interface {
GetTodo(context.Context, *v1.GetTodosRequest) (*v1.GetTodosResponse, error)
ListTodos(context.Context, *v1.ListTodosRequest) (*v1.ListTodosResponse, error)
}
// NewTodoServiceClient constructs a client for the todo.v1.TodoService service. By default, it uses
// the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends
// uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or
// connect.WithGRPCWeb() options.
//
// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
// http://api.acme.com or https://acme.com/grpc).
func NewTodoServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) TodoServiceClient {
baseURL = strings.TrimRight(baseURL, "/")
todoServiceMethods := v1.File_todo_v1_todo_proto.Services().ByName("TodoService").Methods()
return &todoServiceClient{
getTodo: connect.NewClient[v1.GetTodosRequest, v1.GetTodosResponse](
httpClient,
baseURL+TodoServiceGetTodoProcedure,
connect.WithSchema(todoServiceMethods.ByName("GetTodo")),
connect.WithClientOptions(opts...),
),
listTodos: connect.NewClient[v1.ListTodosRequest, v1.ListTodosResponse](
httpClient,
baseURL+TodoServiceListTodosProcedure,
connect.WithSchema(todoServiceMethods.ByName("ListTodos")),
connect.WithClientOptions(opts...),
),
}
}
// todoServiceClient implements TodoServiceClient.
type todoServiceClient struct {
getTodo *connect.Client[v1.GetTodosRequest, v1.GetTodosResponse]
listTodos *connect.Client[v1.ListTodosRequest, v1.ListTodosResponse]
}
// GetTodo calls todo.v1.TodoService.GetTodo.
func (c *todoServiceClient) GetTodo(ctx context.Context, req *v1.GetTodosRequest) (*v1.GetTodosResponse, error) {
response, err := c.getTodo.CallUnary(ctx, connect.NewRequest(req))
if response != nil {
return response.Msg, err
}
return nil, err
}
// ListTodos calls todo.v1.TodoService.ListTodos.
func (c *todoServiceClient) ListTodos(ctx context.Context, req *v1.ListTodosRequest) (*v1.ListTodosResponse, error) {
response, err := c.listTodos.CallUnary(ctx, connect.NewRequest(req))
if response != nil {
return response.Msg, err
}
return nil, err
}
// TodoServiceHandler is an implementation of the todo.v1.TodoService service.
type TodoServiceHandler interface {
GetTodo(context.Context, *v1.GetTodosRequest) (*v1.GetTodosResponse, error)
ListTodos(context.Context, *v1.ListTodosRequest) (*v1.ListTodosResponse, error)
}
// NewTodoServiceHandler builds an HTTP handler from the service implementation. It returns the path
// on which to mount the handler and the handler itself.
//
// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
// and JSON codecs. They also support gzip compression.
func NewTodoServiceHandler(svc TodoServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
todoServiceMethods := v1.File_todo_v1_todo_proto.Services().ByName("TodoService").Methods()
todoServiceGetTodoHandler := connect.NewUnaryHandlerSimple(
TodoServiceGetTodoProcedure,
svc.GetTodo,
connect.WithSchema(todoServiceMethods.ByName("GetTodo")),
connect.WithHandlerOptions(opts...),
)
todoServiceListTodosHandler := connect.NewUnaryHandlerSimple(
TodoServiceListTodosProcedure,
svc.ListTodos,
connect.WithSchema(todoServiceMethods.ByName("ListTodos")),
connect.WithHandlerOptions(opts...),
)
return "/todo.v1.TodoService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
switch r.URL.Path {
case TodoServiceGetTodoProcedure:
todoServiceGetTodoHandler.ServeHTTP(w, r)
case TodoServiceListTodosProcedure:
todoServiceListTodosHandler.ServeHTTP(w, r)
default:
http.NotFound(w, r)
}
})
}
// UnimplementedTodoServiceHandler returns CodeUnimplemented from all methods.
type UnimplementedTodoServiceHandler struct{}
func (UnimplementedTodoServiceHandler) GetTodo(context.Context, *v1.GetTodosRequest) (*v1.GetTodosResponse, error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("todo.v1.TodoService.GetTodo is not implemented"))
}
func (UnimplementedTodoServiceHandler) ListTodos(context.Context, *v1.ListTodosRequest) (*v1.ListTodosResponse, error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("todo.v1.TodoService.ListTodos is not implemented"))
}