taikaiv1

package
v0.0.0-...-be38340 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Overview

Package taikaiv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Api_UpsertHellos_FullMethodName = "/taikai.v1.Api/UpsertHellos"
	Api_DeleteHellos_FullMethodName = "/taikai.v1.Api/DeleteHellos"
	Api_ListHellos_FullMethodName   = "/taikai.v1.Api/ListHellos"
	Api_GetHellos_FullMethodName    = "/taikai.v1.Api/GetHellos"
	Api_Healthy_FullMethodName      = "/taikai.v1.Api/Healthy"
	Api_Ready_FullMethodName        = "/taikai.v1.Api/Ready"
)
View Source
const TimestampFormat = "2006-01-02T15:04:05.999999Z07:00"

cockroachdb doesn't support nanosecond timestamp columns so use microsecond instead

Variables

View Source
var (
	HelloType_name = map[int32]string{
		0: "HELLO_GENERIC",
		1: "HELLO_SPECIFIC",
	}
	HelloType_value = map[string]int32{
		"HELLO_GENERIC":  0,
		"HELLO_SPECIFIC": 1,
	}
)

Enum value maps for HelloType.

View Source
var Api_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "taikai.v1.Api",
	HandlerType: (*ApiServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "UpsertHellos",
			Handler:    _Api_UpsertHellos_Handler,
		},
		{
			MethodName: "DeleteHellos",
			Handler:    _Api_DeleteHellos_Handler,
		},
		{
			MethodName: "ListHellos",
			Handler:    _Api_ListHellos_Handler,
		},
		{
			MethodName: "GetHellos",
			Handler:    _Api_GetHellos_Handler,
		},
		{
			MethodName: "Healthy",
			Handler:    _Api_Healthy_Handler,
		},
		{
			MethodName: "Ready",
			Handler:    _Api_Ready_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "taikai/v1/api.proto",
}

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

View Source
var File_taikai_v1_api_proto protoreflect.FileDescriptor
View Source
var File_taikai_v1_enums_proto protoreflect.FileDescriptor
View Source
var File_taikai_v1_requests_proto protoreflect.FileDescriptor
View Source
var File_taikai_v1_types_proto protoreflect.FileDescriptor

Functions

func AssociateManyToMany

func AssociateManyToMany[L Models, R Models](ctx context.Context, db *gorm.DB, associations *ManyToManyAssociations, associationName string) error

func Delete

func Delete[M Models](ctx context.Context, db *gorm.DB, ids []string) ([]M, error)

Delete is a generic function that will delete any of the generated protos. A function may be provided to be executed during the transaction. The function is executed after the delete. If the function returns an error, the transaction will be rolled back.

func DeleteEventGormModels

func DeleteEventGormModels(ctx context.Context, tx *gorm.DB, ids []string) error

func DeleteGroupGormModels

func DeleteGroupGormModels(ctx context.Context, tx *gorm.DB, ids []string) error

func DeleteHelloGormModels

func DeleteHelloGormModels(ctx context.Context, tx *gorm.DB, ids []string) error

func DeleteOrgGormModels

func DeleteOrgGormModels(ctx context.Context, tx *gorm.DB, ids []string) error

func DeleteUserGormModels

func DeleteUserGormModels(ctx context.Context, tx *gorm.DB, ids []string) error

func DissociateManyToMany

func DissociateManyToMany[L Models, R Models](ctx context.Context, db *gorm.DB, associations *ManyToManyAssociations, associationName string) error

func GetByIds

func GetByIds[M Models](ctx context.Context, db *gorm.DB, ids []string, preloads map[string][]interface{}) ([]M, error)

GetByIds gets the given model type by id

func List

func List[M Models](ctx context.Context, db *gorm.DB, limit, offset int, orderBy string, preloads map[string][]interface{}) ([]M, error)

List lists the given model type

func RegisterApiHandler

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

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

func RegisterApiHandlerClient

func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ApiClient) error

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

func RegisterApiHandlerFromEndpoint

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

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

func RegisterApiHandlerServer

func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ApiServer) error

RegisterApiHandlerServer registers the http handlers for service Api to "mux". UnaryRPC :call ApiServer 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 RegisterApiHandlerFromEndpoint instead.

func RegisterApiServer

func RegisterApiServer(s grpc.ServiceRegistrar, srv ApiServer)

func ReplaceManyToMany

func ReplaceManyToMany[L Models, R Models](ctx context.Context, db *gorm.DB, associations *ManyToManyAssociations, associationName string) error

func ToModels

func ToModels[P Protos, M Models](protos interface{}) ([]M, error)

ToModels converts an array of protos to an array of gorm db models by calling the proto's ToModel method

func ToProtos

func ToProtos[P Protos, M Models](models interface{}) ([]P, error)

ToProtos converts an array of models into an array of protos by calling the model's ToProto method

func Upsert

func Upsert[P Protos, M Models](ctx context.Context, db *gorm.DB, protos interface{}) ([]M, error)

Upsert is a generic function that will upsert any of the generated protos, returning the upserted models. Upsert excludes all associations, and uses an on conflict clause to handle upsert. A function may be provided to be executed during the transaction. The function is executed after the upsert. If the function returns an error, the transaction will be rolled back.

Types

type ApiClient

type ApiClient interface {
	UpsertHellos(ctx context.Context, in *UpsertHellosRequest, opts ...grpc.CallOption) (*Hellos, error)
	DeleteHellos(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
	ListHellos(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*Hellos, error)
	GetHellos(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*Hellos, error)
	// Health check
	Healthy(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
	// Readiness check
	Ready(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
}

ApiClient is the client API for Api 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 NewApiClient

func NewApiClient(cc grpc.ClientConnInterface) ApiClient

type ApiServer

type ApiServer interface {
	UpsertHellos(context.Context, *UpsertHellosRequest) (*Hellos, error)
	DeleteHellos(context.Context, *DeleteRequest) (*DeleteResponse, error)
	ListHellos(context.Context, *ListRequest) (*Hellos, error)
	GetHellos(context.Context, *GetRequest) (*Hellos, error)
	// Health check
	Healthy(context.Context, *Empty) (*Empty, error)
	// Readiness check
	Ready(context.Context, *Empty) (*Empty, error)
}

ApiServer is the server API for Api service. All implementations should embed UnimplementedApiServer for forward compatibility

type DeleteRequest

type DeleteRequest struct {
	Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteRequest) Descriptor deprecated

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

Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.

func (*DeleteRequest) GetIds

func (x *DeleteRequest) GetIds() []string

func (*DeleteRequest) MarshalJSON

func (msg *DeleteRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) ProtoReflect

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

func (*DeleteRequest) Reset

func (x *DeleteRequest) Reset()

func (*DeleteRequest) String

func (x *DeleteRequest) String() string

func (*DeleteRequest) UnmarshalJSON

func (msg *DeleteRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

func (*DeleteRequest) Validate

func (m *DeleteRequest) Validate() error

Validate checks the field values on DeleteRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*DeleteRequest) ValidateAll

func (m *DeleteRequest) ValidateAll() error

ValidateAll checks the field values on DeleteRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in DeleteRequestMultiError, or nil if none found.

type DeleteRequestMultiError

type DeleteRequestMultiError []error

DeleteRequestMultiError is an error wrapping multiple validation errors returned by DeleteRequest.ValidateAll() if the designated constraints aren't met.

func (DeleteRequestMultiError) AllErrors

func (m DeleteRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (DeleteRequestMultiError) Error

func (m DeleteRequestMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type DeleteRequestValidationError

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

DeleteRequestValidationError is the validation error returned by DeleteRequest.Validate if the designated constraints aren't met.

func (DeleteRequestValidationError) Cause

Cause function returns cause value.

func (DeleteRequestValidationError) Error

Error satisfies the builtin error interface

func (DeleteRequestValidationError) ErrorName

func (e DeleteRequestValidationError) ErrorName() string

ErrorName returns error name.

func (DeleteRequestValidationError) Field

Field function returns field value.

func (DeleteRequestValidationError) Key

Key function returns key value.

func (DeleteRequestValidationError) Reason

Reason function returns reason value.

type DeleteResponse

type DeleteResponse struct {
	Errors []string `protobuf:"bytes,1,rep,name=errors,proto3" json:"errors,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteResponse) Descriptor deprecated

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

Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead.

func (*DeleteResponse) GetErrors

func (x *DeleteResponse) GetErrors() []string

func (*DeleteResponse) MarshalJSON

func (msg *DeleteResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*DeleteResponse) ProtoMessage

func (*DeleteResponse) ProtoMessage()

func (*DeleteResponse) ProtoReflect

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

func (*DeleteResponse) Reset

func (x *DeleteResponse) Reset()

func (*DeleteResponse) String

func (x *DeleteResponse) String() string

func (*DeleteResponse) UnmarshalJSON

func (msg *DeleteResponse) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

func (*DeleteResponse) Validate

func (m *DeleteResponse) Validate() error

Validate checks the field values on DeleteResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*DeleteResponse) ValidateAll

func (m *DeleteResponse) ValidateAll() error

ValidateAll checks the field values on DeleteResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in DeleteResponseMultiError, or nil if none found.

type DeleteResponseMultiError

type DeleteResponseMultiError []error

DeleteResponseMultiError is an error wrapping multiple validation errors returned by DeleteResponse.ValidateAll() if the designated constraints aren't met.

func (DeleteResponseMultiError) AllErrors

func (m DeleteResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (DeleteResponseMultiError) Error

func (m DeleteResponseMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type DeleteResponseValidationError

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

DeleteResponseValidationError is the validation error returned by DeleteResponse.Validate if the designated constraints aren't met.

func (DeleteResponseValidationError) Cause

Cause function returns cause value.

func (DeleteResponseValidationError) Error

Error satisfies the builtin error interface

func (DeleteResponseValidationError) ErrorName

func (e DeleteResponseValidationError) ErrorName() string

ErrorName returns error name.

func (DeleteResponseValidationError) Field

Field function returns field value.

func (DeleteResponseValidationError) Key

Key function returns key value.

func (DeleteResponseValidationError) Reason

Reason function returns reason value.

type Empty

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

Do not delete these unless you know what you're doing

func (*Empty) Descriptor deprecated

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

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) MarshalJSON

func (msg *Empty) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

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

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

func (*Empty) UnmarshalJSON

func (msg *Empty) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

func (*Empty) Validate

func (m *Empty) Validate() error

Validate checks the field values on Empty with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Empty) ValidateAll

func (m *Empty) ValidateAll() error

ValidateAll checks the field values on Empty with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in EmptyMultiError, or nil if none found.

type EmptyMultiError

type EmptyMultiError []error

EmptyMultiError is an error wrapping multiple validation errors returned by Empty.ValidateAll() if the designated constraints aren't met.

func (EmptyMultiError) AllErrors

func (m EmptyMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (EmptyMultiError) Error

func (m EmptyMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type EmptyValidationError

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

EmptyValidationError is the validation error returned by Empty.Validate if the designated constraints aren't met.

func (EmptyValidationError) Cause

func (e EmptyValidationError) Cause() error

Cause function returns cause value.

func (EmptyValidationError) Error

func (e EmptyValidationError) Error() string

Error satisfies the builtin error interface

func (EmptyValidationError) ErrorName

func (e EmptyValidationError) ErrorName() string

ErrorName returns error name.

func (EmptyValidationError) Field

func (e EmptyValidationError) Field() string

Field function returns field value.

func (EmptyValidationError) Key

func (e EmptyValidationError) Key() bool

Key function returns key value.

func (EmptyValidationError) Reason

func (e EmptyValidationError) Reason() string

Reason function returns reason value.

type Event

type Event struct {

	// @gotags: fake:"skip"
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty" fake:"skip"`
	// @gotags: fake:"skip"
	Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty" fake:"skip"`
	// @gotags: fake:"skip"
	GroupId string `protobuf:"bytes,3,opt,name=group_id,proto3" json:"group_id,omitempty" fake:"skip"`
	// @gotags: fake:"skip"
	Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty" fake:"skip"`
	// @gotags: fake:"skip"
	Location string `protobuf:"bytes,5,opt,name=location,proto3" json:"location,omitempty" fake:"skip"`
	// @gotags: fake:"skip"
	Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty" fake:"skip"`
	// @gotags: fake:"skip"
	UserIds []*User `protobuf:"bytes,7,rep,name=user_ids,proto3" json:"user_ids,omitempty" fake:"skip"`
	// @gotags: fake:"skip"
	StartTime *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=start_time,proto3" json:"start_time,omitempty" fake:"skip"`
	// @gotags: fake:"skip"
	EndTime *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=end_time,proto3" json:"end_time,omitempty" fake:"skip"`
	// @gotags: fake:"skip"
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=created_at,proto3" json:"created_at,omitempty" fake:"skip"`
	// @gotags: fake:"skip"
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=updated_at,proto3" json:"updated_at,omitempty" fake:"skip"`
	// @gotags: fake:"skip"
	DeletedAt *timestamppb.Timestamp `protobuf:"bytes,12,opt,name=deleted_at,proto3" json:"deleted_at,omitempty" fake:"skip"`
	// contains filtered or unexported fields
}

func (*Event) Descriptor deprecated

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

Deprecated: Use Event.ProtoReflect.Descriptor instead.

func (*Event) GetCreatedAt

func (x *Event) GetCreatedAt() *timestamppb.Timestamp

func (*Event) GetDeletedAt

func (x *Event) GetDeletedAt() *timestamppb.Timestamp

func (*Event) GetDescription

func (x *Event) GetDescription() string

func (*Event) GetEndTime

func (x *Event) GetEndTime() *timestamppb.Timestamp

func (*Event) GetGroupId

func (x *Event) GetGroupId() string

func (*Event) GetId

func (x *Event) GetId() string

func (*Event) GetLocation

func (x *Event) GetLocation() string

func (*Event) GetName

func (x *Event) GetName() string

func (*Event) GetProtoId

func (p *Event) GetProtoId() *string

func (*Event) GetStartTime

func (x *Event) GetStartTime() *timestamppb.Timestamp

func (*Event) GetTitle

func (x *Event) GetTitle() string

func (*Event) GetUpdatedAt

func (x *Event) GetUpdatedAt() *timestamppb.Timestamp

func (*Event) GetUserIds

func (x *Event) GetUserIds() []*User

func (*Event) MarshalJSON

func (msg *Event) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) ProtoReflect

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

func (*Event) Reset

func (x *Event) Reset()

func (*Event) SetProtoId

func (p *Event) SetProtoId(id string)

func (*Event) String

func (x *Event) String() string

func (*Event) ToModel

func (p *Event) ToModel() (theModel *EventGormModel, err error)

func (*Event) UnmarshalJSON

func (msg *Event) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

func (*Event) Validate

func (m *Event) Validate() error

Validate checks the field values on Event with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Event) ValidateAll

func (m *Event) ValidateAll() error

ValidateAll checks the field values on Event with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in EventMultiError, or nil if none found.

type EventGormModel

type EventGormModel struct {

	// @gotags: fake:"skip"
	Name string `json:"name" fake:"skip"`

	// @gotags: fake:"skip"
	Id string `gorm:"type:uuid;primaryKey;default:uuid_generate_v4();" json:"id" fake:"skip"`

	// @gotags: fake:"skip"
	GroupId string `json:"group_id" fake:"skip"`

	// @gotags: fake:"skip"
	Title string `json:"title" fake:"skip"`

	// @gotags: fake:"skip"
	Location string `json:"location" fake:"skip"`

	// @gotags: fake:"skip"
	Description string `json:"description" fake:"skip"`

	// @gotags: fake:"skip"
	UserIds []*UserGormModel `json:"user_ids" fake:"skip"`

	// @gotags: fake:"skip"
	StartTime *time.Time `gorm:"type:timestamp;" json:"start_time" fake:"skip"`

	// @gotags: fake:"skip"
	EndTime *time.Time `gorm:"type:timestamp;" json:"end_time" fake:"skip"`

	// @gotags: fake:"skip"
	CreatedAt *time.Time `gorm:"type:timestamp;" json:"created_at" fake:"skip"`

	// @gotags: fake:"skip"
	UpdatedAt *time.Time `gorm:"type:timestamp;" json:"updated_at" fake:"skip"`

	// @gotags: fake:"skip"
	DeletedAt *time.Time `gorm:"type:timestamp;" json:"deleted_at" fake:"skip"`
}

func (*EventGormModel) GetModelId

func (m *EventGormModel) GetModelId() *string

func (*EventGormModel) New

func (m *EventGormModel) New() interface{}

func (*EventGormModel) SetModelId

func (m *EventGormModel) SetModelId(id string)

func (*EventGormModel) TableName

func (m *EventGormModel) TableName() string

func (*EventGormModel) ToProto

func (m *EventGormModel) ToProto() (theProto *Event, err error)

type EventGormModels

type EventGormModels []*EventGormModel

func (EventGormModels) GetByModelIds

func (m EventGormModels) GetByModelIds(ctx context.Context, tx *gorm.DB, preloads ...string) (err error)

func (EventGormModels) ToProtos

func (m EventGormModels) ToProtos() (protos EventProtos, err error)

type EventMultiError

type EventMultiError []error

EventMultiError is an error wrapping multiple validation errors returned by Event.ValidateAll() if the designated constraints aren't met.

func (EventMultiError) AllErrors

func (m EventMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (EventMultiError) Error

func (m EventMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type EventProtos

type EventProtos []*Event

func (*EventProtos) GetByIds

func (p *EventProtos) GetByIds(ctx context.Context, tx *gorm.DB, ids []string, preloads ...string) (err error)

func (*EventProtos) List

func (p *EventProtos) List(ctx context.Context, tx *gorm.DB, limit, offset int, order interface{}, preloads ...string) (err error)

func (EventProtos) ToModels

func (p EventProtos) ToModels() (models EventGormModels, err error)

func (*EventProtos) Upsert

func (p *EventProtos) Upsert(ctx context.Context, tx *gorm.DB) (models EventGormModels, err error)

Upsert creates the protos using an on conflict clause to do updates. This function does not update *any* associations use gorm's association mode functions to update associations as you see fit after calling upsert. See https://gorm.io/docs/associations.html#Replace-Associations

type EventValidationError

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

EventValidationError is the validation error returned by Event.Validate if the designated constraints aren't met.

func (EventValidationError) Cause

func (e EventValidationError) Cause() error

Cause function returns cause value.

func (EventValidationError) Error

func (e EventValidationError) Error() string

Error satisfies the builtin error interface

func (EventValidationError) ErrorName

func (e EventValidationError) ErrorName() string

ErrorName returns error name.

func (EventValidationError) Field

func (e EventValidationError) Field() string

Field function returns field value.

func (EventValidationError) Key

func (e EventValidationError) Key() bool

Key function returns key value.

func (EventValidationError) Reason

func (e EventValidationError) Reason() string

Reason function returns reason value.

type GetRequest

type GetRequest struct {
	Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"`
	// contains filtered or unexported fields
}

func (*GetRequest) Descriptor deprecated

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

Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.

func (*GetRequest) GetIds

func (x *GetRequest) GetIds() []string

func (*GetRequest) MarshalJSON

func (msg *GetRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) ProtoReflect

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

func (*GetRequest) Reset

func (x *GetRequest) Reset()

func (*GetRequest) String

func (x *GetRequest) String() string

func (*GetRequest) UnmarshalJSON

func (msg *GetRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

func (*GetRequest) Validate

func (m *GetRequest) Validate() error

Validate checks the field values on GetRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*GetRequest) ValidateAll

func (m *GetRequest) ValidateAll() error

ValidateAll checks the field values on GetRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in GetRequestMultiError, or nil if none found.

type GetRequestMultiError

type GetRequestMultiError []error

GetRequestMultiError is an error wrapping multiple validation errors returned by GetRequest.ValidateAll() if the designated constraints aren't met.

func (GetRequestMultiError) AllErrors

func (m GetRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetRequestMultiError) Error

func (m GetRequestMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type GetRequestValidationError

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

GetRequestValidationError is the validation error returned by GetRequest.Validate if the designated constraints aren't met.

func (GetRequestValidationError) Cause

func (e GetRequestValidationError) Cause() error

Cause function returns cause value.

func (GetRequestValidationError) Error

Error satisfies the builtin error interface

func (GetRequestValidationError) ErrorName

func (e GetRequestValidationError) ErrorName() string

ErrorName returns error name.

func (GetRequestValidationError) Field

Field function returns field value.

func (GetRequestValidationError) Key

Key function returns key value.

func (GetRequestValidationError) Reason

func (e GetRequestValidationError) Reason() string

Reason function returns reason value.

type Group

type Group struct {

	// @gotags: fake:"skip"
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty" fake:"skip"`
	// @gotags: fake:"skip"
	Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty" fake:"skip"`
	// @gotags: fake:"skip"
	OrgId string `protobuf:"bytes,3,opt,name=org_id,proto3" json:"org_id,omitempty" fake:"skip"`
	// @gotags: fake:"skip"
	OwnerIds []string `protobuf:"bytes,4,rep,name=owner_ids,proto3" json:"owner_ids,omitempty" fake:"skip"`
	// @gotags: fake:"skip"
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,proto3" json:"created_at,omitempty" fake:"skip"`
	// @gotags: fake:"skip"
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updated_at,proto3" json:"updated_at,omitempty" fake:"skip"`
	// @gotags: fake:"skip"
	DeletedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=deleted_at,proto3" json:"deleted_at,omitempty" fake:"skip"`
	// contains filtered or unexported fields
}

func (*Group) Descriptor deprecated

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

Deprecated: Use Group.ProtoReflect.Descriptor instead.

func (*Group) GetCreatedAt

func (x *Group) GetCreatedAt() *timestamppb.Timestamp

func (*Group) GetDeletedAt

func (x *Group) GetDeletedAt() *timestamppb.Timestamp

func (*Group) GetId

func (x *Group) GetId() string

func (*Group) GetName

func (x *Group) GetName() string

func (*Group) GetOrgId

func (x *Group) GetOrgId() string

func (*Group) GetOwnerIds

func (x *Group) GetOwnerIds() []string

func (*Group) GetProtoId

func (p *Group) GetProtoId() *string

func (*Group) GetUpdatedAt

func (x *Group) GetUpdatedAt() *timestamppb.Timestamp

func (*Group) MarshalJSON

func (msg *Group) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*Group) ProtoMessage

func (*Group) ProtoMessage()

func (*Group) ProtoReflect

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

func (*Group) Reset

func (x *Group) Reset()

func (*Group) SetProtoId

func (p *Group) SetProtoId(id string)

func (*Group) String

func (x *Group) String() string

func (*Group) ToModel

func (p *Group) ToModel() (theModel *GroupGormModel, err error)

func (*Group) UnmarshalJSON

func (msg *Group) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

func (*Group) Validate

func (m *Group) Validate() error

Validate checks the field values on Group with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Group) ValidateAll

func (m *Group) ValidateAll() error

ValidateAll checks the field values on Group with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in GroupMultiError, or nil if none found.

type GroupGormModel

type GroupGormModel struct {

	// @gotags: fake:"skip"
	Name string `json:"name" fake:"skip"`

	// @gotags: fake:"skip"
	Id string `gorm:"type:uuid;primaryKey;default:uuid_generate_v4();" json:"id" fake:"skip"`

	// @gotags: fake:"skip"
	OrgId string `json:"org_id" fake:"skip"`

	// @gotags: fake:"skip"
	OwnerIds pq.StringArray `gorm:"type:text[];" json:"owner_ids" fake:"skip"`

	// @gotags: fake:"skip"
	CreatedAt *time.Time `gorm:"type:timestamp;" json:"created_at" fake:"skip"`

	// @gotags: fake:"skip"
	UpdatedAt *time.Time `gorm:"type:timestamp;" json:"updated_at" fake:"skip"`

	// @gotags: fake:"skip"
	DeletedAt *time.Time `gorm:"type:timestamp;" json:"deleted_at" fake:"skip"`
}

func (*GroupGormModel) GetModelId

func (m *GroupGormModel) GetModelId() *string

func (*GroupGormModel) New

func (m *GroupGormModel) New() interface{}

func (*GroupGormModel) SetModelId

func (m *GroupGormModel) SetModelId(id string)

func (*GroupGormModel) TableName

func (m *GroupGormModel) TableName() string

func (*GroupGormModel) ToProto

func (m *GroupGormModel) ToProto() (theProto *Group, err error)

type GroupGormModels

type GroupGormModels []*GroupGormModel

func (GroupGormModels) GetByModelIds

func (m GroupGormModels) GetByModelIds(ctx context.Context, tx *gorm.DB, preloads ...string) (err error)

func (GroupGormModels) ToProtos

func (m GroupGormModels) ToProtos() (protos GroupProtos, err error)

type GroupMultiError

type GroupMultiError []error

GroupMultiError is an error wrapping multiple validation errors returned by Group.ValidateAll() if the designated constraints aren't met.

func (GroupMultiError) AllErrors

func (m GroupMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GroupMultiError) Error

func (m GroupMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type GroupProtos

type GroupProtos []*Group

func (*GroupProtos) GetByIds

func (p *GroupProtos) GetByIds(ctx context.Context, tx *gorm.DB, ids []string, preloads ...string) (err error)

func (*GroupProtos) List

func (p *GroupProtos) List(ctx context.Context, tx *gorm.DB, limit, offset int, order interface{}, preloads ...string) (err error)

func (GroupProtos) ToModels

func (p GroupProtos) ToModels() (models GroupGormModels, err error)

func (*GroupProtos) Upsert

func (p *GroupProtos) Upsert(ctx context.Context, tx *gorm.DB) (models GroupGormModels, err error)

Upsert creates the protos using an on conflict clause to do updates. This function does not update *any* associations use gorm's association mode functions to update associations as you see fit after calling upsert. See https://gorm.io/docs/associations.html#Replace-Associations

type GroupValidationError

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

GroupValidationError is the validation error returned by Group.Validate if the designated constraints aren't met.

func (GroupValidationError) Cause

func (e GroupValidationError) Cause() error

Cause function returns cause value.

func (GroupValidationError) Error

func (e GroupValidationError) Error() string

Error satisfies the builtin error interface

func (GroupValidationError) ErrorName

func (e GroupValidationError) ErrorName() string

ErrorName returns error name.

func (GroupValidationError) Field

func (e GroupValidationError) Field() string

Field function returns field value.

func (GroupValidationError) Key

func (e GroupValidationError) Key() bool

Key function returns key value.

func (GroupValidationError) Reason

func (e GroupValidationError) Reason() string

Reason function returns reason value.

type Hello

type Hello struct {

	// @gotags: fake:"skip"
	Id *string `protobuf:"bytes,1,opt,name=id,proto3,oneof" json:"id,omitempty" fake:"skip"`
	// @gotags: fake:"skip"
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=created_at,proto3" json:"created_at,omitempty" fake:"skip"`
	// @gotags: fake:"skip"
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=updated_at,proto3" json:"updated_at,omitempty" fake:"skip"`
	// @gotags: fake:"{number:1,1}"
	HelloType HelloType `protobuf:"varint,4,opt,name=hello_type,proto3,enum=taikai.v1.HelloType" json:"hello_type,omitempty" fake:"{number:1,1}"`
	// @gotags: fake:"{beername}"
	PersonName *string `protobuf:"bytes,5,opt,name=person_name,proto3,oneof" json:"person_name,omitempty" fake:"{beername}"`
	// contains filtered or unexported fields
}

func (*Hello) Descriptor deprecated

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

Deprecated: Use Hello.ProtoReflect.Descriptor instead.

func (*Hello) GetCreatedAt

func (x *Hello) GetCreatedAt() *timestamppb.Timestamp

func (*Hello) GetHelloType

func (x *Hello) GetHelloType() HelloType

func (*Hello) GetId

func (x *Hello) GetId() string

func (*Hello) GetPersonName

func (x *Hello) GetPersonName() string

func (*Hello) GetProtoId

func (p *Hello) GetProtoId() *string

func (*Hello) GetUpdatedAt

func (x *Hello) GetUpdatedAt() *timestamppb.Timestamp

func (*Hello) MarshalJSON

func (msg *Hello) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*Hello) ProtoMessage

func (*Hello) ProtoMessage()

func (*Hello) ProtoReflect

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

func (*Hello) Reset

func (x *Hello) Reset()

func (*Hello) SetProtoId

func (p *Hello) SetProtoId(id string)

func (*Hello) String

func (x *Hello) String() string

func (*Hello) ToModel

func (p *Hello) ToModel() (theModel *HelloGormModel, err error)

func (*Hello) UnmarshalJSON

func (msg *Hello) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

func (*Hello) Validate

func (m *Hello) Validate() error

Validate checks the field values on Hello with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Hello) ValidateAll

func (m *Hello) ValidateAll() error

ValidateAll checks the field values on Hello with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in HelloMultiError, or nil if none found.

type HelloGormModel

type HelloGormModel struct {

	// @gotags: fake:"skip"
	Id *string `gorm:"type:uuid;primaryKey;default:uuid_generate_v4();" json:"id" fake:"skip"`

	// @gotags: fake:"skip"
	CreatedAt *time.Time `gorm:"type:timestamp;" json:"created_at" fake:"skip"`

	// @gotags: fake:"skip"
	UpdatedAt *time.Time `gorm:"type:timestamp;" json:"updated_at" fake:"skip"`

	// @gotags: fake:"{number:1,1}"
	HelloType int `json:"hello_type" fake:"{number:1,1}"`

	// @gotags: fake:"{beername}"
	PersonName *string `json:"person_name" fake:"{beername}"`
}

func (*HelloGormModel) GetModelId

func (m *HelloGormModel) GetModelId() *string

func (*HelloGormModel) New

func (m *HelloGormModel) New() interface{}

func (*HelloGormModel) SetModelId

func (m *HelloGormModel) SetModelId(id string)

func (*HelloGormModel) TableName

func (m *HelloGormModel) TableName() string

func (*HelloGormModel) ToProto

func (m *HelloGormModel) ToProto() (theProto *Hello, err error)

type HelloGormModels

type HelloGormModels []*HelloGormModel

func (HelloGormModels) GetByModelIds

func (m HelloGormModels) GetByModelIds(ctx context.Context, tx *gorm.DB, preloads ...string) (err error)

func (HelloGormModels) ToProtos

func (m HelloGormModels) ToProtos() (protos HelloProtos, err error)

type HelloMultiError

type HelloMultiError []error

HelloMultiError is an error wrapping multiple validation errors returned by Hello.ValidateAll() if the designated constraints aren't met.

func (HelloMultiError) AllErrors

func (m HelloMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (HelloMultiError) Error

func (m HelloMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type HelloProtos

type HelloProtos []*Hello

func (*HelloProtos) GetByIds

func (p *HelloProtos) GetByIds(ctx context.Context, tx *gorm.DB, ids []string, preloads ...string) (err error)

func (*HelloProtos) List

func (p *HelloProtos) List(ctx context.Context, tx *gorm.DB, limit, offset int, order interface{}, preloads ...string) (err error)

func (HelloProtos) ToModels

func (p HelloProtos) ToModels() (models HelloGormModels, err error)

func (*HelloProtos) Upsert

func (p *HelloProtos) Upsert(ctx context.Context, tx *gorm.DB) (models HelloGormModels, err error)

Upsert creates the protos using an on conflict clause to do updates. This function does not update *any* associations use gorm's association mode functions to update associations as you see fit after calling upsert. See https://gorm.io/docs/associations.html#Replace-Associations

type HelloType

type HelloType int32
const (
	HelloType_HELLO_GENERIC  HelloType = 0
	HelloType_HELLO_SPECIFIC HelloType = 1
)

func (HelloType) Descriptor

func (HelloType) Descriptor() protoreflect.EnumDescriptor

func (HelloType) Enum

func (x HelloType) Enum() *HelloType

func (HelloType) EnumDescriptor deprecated

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

Deprecated: Use HelloType.Descriptor instead.

func (HelloType) Number

func (x HelloType) Number() protoreflect.EnumNumber

func (HelloType) String

func (x HelloType) String() string

func (HelloType) Type

type HelloValidationError

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

HelloValidationError is the validation error returned by Hello.Validate if the designated constraints aren't met.

func (HelloValidationError) Cause

func (e HelloValidationError) Cause() error

Cause function returns cause value.

func (HelloValidationError) Error

func (e HelloValidationError) Error() string

Error satisfies the builtin error interface

func (HelloValidationError) ErrorName

func (e HelloValidationError) ErrorName() string

ErrorName returns error name.

func (HelloValidationError) Field

func (e HelloValidationError) Field() string

Field function returns field value.

func (HelloValidationError) Key

func (e HelloValidationError) Key() bool

Key function returns key value.

func (HelloValidationError) Reason

func (e HelloValidationError) Reason() string

Reason function returns reason value.

type Hellos

type Hellos struct {
	Hellos []*Hello `protobuf:"bytes,1,rep,name=hellos,proto3" json:"hellos,omitempty"`
	// contains filtered or unexported fields
}

Below here are the messages that aren't generic

func (*Hellos) Descriptor deprecated

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

Deprecated: Use Hellos.ProtoReflect.Descriptor instead.

func (*Hellos) GetHellos

func (x *Hellos) GetHellos() []*Hello

func (*Hellos) MarshalJSON

func (msg *Hellos) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*Hellos) ProtoMessage

func (*Hellos) ProtoMessage()

func (*Hellos) ProtoReflect

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

func (*Hellos) Reset

func (x *Hellos) Reset()

func (*Hellos) String

func (x *Hellos) String() string

func (*Hellos) UnmarshalJSON

func (msg *Hellos) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

func (*Hellos) Validate

func (m *Hellos) Validate() error

Validate checks the field values on Hellos with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Hellos) ValidateAll

func (m *Hellos) ValidateAll() error

ValidateAll checks the field values on Hellos with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in HellosMultiError, or nil if none found.

type HellosMultiError

type HellosMultiError []error

HellosMultiError is an error wrapping multiple validation errors returned by Hellos.ValidateAll() if the designated constraints aren't met.

func (HellosMultiError) AllErrors

func (m HellosMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (HellosMultiError) Error

func (m HellosMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type HellosValidationError

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

HellosValidationError is the validation error returned by Hellos.Validate if the designated constraints aren't met.

func (HellosValidationError) Cause

func (e HellosValidationError) Cause() error

Cause function returns cause value.

func (HellosValidationError) Error

func (e HellosValidationError) Error() string

Error satisfies the builtin error interface

func (HellosValidationError) ErrorName

func (e HellosValidationError) ErrorName() string

ErrorName returns error name.

func (HellosValidationError) Field

func (e HellosValidationError) Field() string

Field function returns field value.

func (HellosValidationError) Key

func (e HellosValidationError) Key() bool

Key function returns key value.

func (HellosValidationError) Reason

func (e HellosValidationError) Reason() string

Reason function returns reason value.

type ListRequest

type ListRequest struct {
	Limit   int32  `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"`
	Offset  int32  `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
	OrderBy string `protobuf:"bytes,3,opt,name=orderBy,proto3" json:"orderBy,omitempty"`
	// contains filtered or unexported fields
}

func (*ListRequest) Descriptor deprecated

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

Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.

func (*ListRequest) GetLimit

func (x *ListRequest) GetLimit() int32

func (*ListRequest) GetOffset

func (x *ListRequest) GetOffset() int32

func (*ListRequest) GetOrderBy

func (x *ListRequest) GetOrderBy() string

func (*ListRequest) MarshalJSON

func (msg *ListRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*ListRequest) ProtoMessage

func (*ListRequest) ProtoMessage()

func (*ListRequest) ProtoReflect

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

func (*ListRequest) Reset

func (x *ListRequest) Reset()

func (*ListRequest) String

func (x *ListRequest) String() string

func (*ListRequest) UnmarshalJSON

func (msg *ListRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

func (*ListRequest) Validate

func (m *ListRequest) Validate() error

Validate checks the field values on ListRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ListRequest) ValidateAll

func (m *ListRequest) ValidateAll() error

ValidateAll checks the field values on ListRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ListRequestMultiError, or nil if none found.

type ListRequestMultiError

type ListRequestMultiError []error

ListRequestMultiError is an error wrapping multiple validation errors returned by ListRequest.ValidateAll() if the designated constraints aren't met.

func (ListRequestMultiError) AllErrors

func (m ListRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ListRequestMultiError) Error

func (m ListRequestMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type ListRequestValidationError

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

ListRequestValidationError is the validation error returned by ListRequest.Validate if the designated constraints aren't met.

func (ListRequestValidationError) Cause

Cause function returns cause value.

func (ListRequestValidationError) Error

Error satisfies the builtin error interface

func (ListRequestValidationError) ErrorName

func (e ListRequestValidationError) ErrorName() string

ErrorName returns error name.

func (ListRequestValidationError) Field

Field function returns field value.

func (ListRequestValidationError) Key

Key function returns key value.

func (ListRequestValidationError) Reason

Reason function returns reason value.

type ManyToManyAssociations

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

ManyToManyAssociations is a sync map with helper functions. I'm using a sync.map so that it's thread safe, and a struct to allow us to easily define behavior we can use elsewhere

func (*ManyToManyAssociations) AddAssociation

func (m *ManyToManyAssociations) AddAssociation(modelId, associatedId string)

func (*ManyToManyAssociations) Associations

func (m *ManyToManyAssociations) Associations() map[string][]string

type Model

type Model[P Protos] interface {
	ToProto() (P, error)
}

Model[P Protos] is an interface type that defines behavior for the implementer of a given Protos type

func ConvertModelToModelP

func ConvertModelToModelP[P Protos, M Models](model interface{}) Model[P]

ConvertProtoToProtosM converts a single proto to a Proto[M]

func ConvertModelsToModelsP

func ConvertModelsToModelsP[P Protos, M Models](models interface{}) []Model[P]

ConvertProtosToProtosM converts a given slice of protos into an array of the Proto interface type, which can then leverage the interface methods

type Models

type Models interface {
	*HelloGormModel | *OrgGormModel | *UserGormModel | *GroupGormModel | *EventGormModel
	GetModelId() *string
	SetModelId(string)
	New() interface{}
	TableName() string // tabler interface for gorm model, gives us access to the table name that gorm will use, see https://gorm.io/docs/conventions.html#TableName
}

Models is a union of other types that defines which types may be used in generic functions

type Org

type Org struct {

	// @gotags: fake:"skip"
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty" fake:"skip"`
	// @gotags: fake:"skip"
	Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty" fake:"skip"`
	// @gotags: fake:"skip"
	Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty" fake:"skip"`
	// @gotags: fake:"skip"
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=created_at,proto3" json:"created_at,omitempty" fake:"skip"`
	// @gotags: fake:"skip"
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=updated_at,proto3" json:"updated_at,omitempty" fake:"skip"`
	// @gotags: fake:"skip"
	DeletedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=deleted_at,proto3" json:"deleted_at,omitempty" fake:"skip"`
	// contains filtered or unexported fields
}

func (*Org) Descriptor deprecated

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

Deprecated: Use Org.ProtoReflect.Descriptor instead.

func (*Org) GetCreatedAt

func (x *Org) GetCreatedAt() *timestamppb.Timestamp

func (*Org) GetDeletedAt

func (x *Org) GetDeletedAt() *timestamppb.Timestamp

func (*Org) GetDescription

func (x *Org) GetDescription() string

func (*Org) GetId

func (x *Org) GetId() string

func (*Org) GetName

func (x *Org) GetName() string

func (*Org) GetProtoId

func (p *Org) GetProtoId() *string

func (*Org) GetUpdatedAt

func (x *Org) GetUpdatedAt() *timestamppb.Timestamp

func (*Org) MarshalJSON

func (msg *Org) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*Org) ProtoMessage

func (*Org) ProtoMessage()

func (*Org) ProtoReflect

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

func (*Org) Reset

func (x *Org) Reset()

func (*Org) SetProtoId

func (p *Org) SetProtoId(id string)

func (*Org) String

func (x *Org) String() string

func (*Org) ToModel

func (p *Org) ToModel() (theModel *OrgGormModel, err error)

func (*Org) UnmarshalJSON

func (msg *Org) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

func (*Org) Validate

func (m *Org) Validate() error

Validate checks the field values on Org with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Org) ValidateAll

func (m *Org) ValidateAll() error

ValidateAll checks the field values on Org with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in OrgMultiError, or nil if none found.

type OrgGormModel

type OrgGormModel struct {

	// @gotags: fake:"skip"
	Name string `json:"name" fake:"skip"`

	// @gotags: fake:"skip"
	Id string `gorm:"type:uuid;primaryKey;default:uuid_generate_v4();" json:"id" fake:"skip"`

	// @gotags: fake:"skip"
	Description string `json:"description" fake:"skip"`

	// @gotags: fake:"skip"
	CreatedAt *time.Time `gorm:"type:timestamp;" json:"created_at" fake:"skip"`

	// @gotags: fake:"skip"
	UpdatedAt *time.Time `gorm:"type:timestamp;" json:"updated_at" fake:"skip"`

	// @gotags: fake:"skip"
	DeletedAt *time.Time `gorm:"type:timestamp;" json:"deleted_at" fake:"skip"`
}

func (*OrgGormModel) GetModelId

func (m *OrgGormModel) GetModelId() *string

func (*OrgGormModel) New

func (m *OrgGormModel) New() interface{}

func (*OrgGormModel) SetModelId

func (m *OrgGormModel) SetModelId(id string)

func (*OrgGormModel) TableName

func (m *OrgGormModel) TableName() string

func (*OrgGormModel) ToProto

func (m *OrgGormModel) ToProto() (theProto *Org, err error)

type OrgGormModels

type OrgGormModels []*OrgGormModel

func (OrgGormModels) GetByModelIds

func (m OrgGormModels) GetByModelIds(ctx context.Context, tx *gorm.DB, preloads ...string) (err error)

func (OrgGormModels) ToProtos

func (m OrgGormModels) ToProtos() (protos OrgProtos, err error)

type OrgMultiError

type OrgMultiError []error

OrgMultiError is an error wrapping multiple validation errors returned by Org.ValidateAll() if the designated constraints aren't met.

func (OrgMultiError) AllErrors

func (m OrgMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (OrgMultiError) Error

func (m OrgMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type OrgProtos

type OrgProtos []*Org

func (*OrgProtos) GetByIds

func (p *OrgProtos) GetByIds(ctx context.Context, tx *gorm.DB, ids []string, preloads ...string) (err error)

func (*OrgProtos) List

func (p *OrgProtos) List(ctx context.Context, tx *gorm.DB, limit, offset int, order interface{}, preloads ...string) (err error)

func (OrgProtos) ToModels

func (p OrgProtos) ToModels() (models OrgGormModels, err error)

func (*OrgProtos) Upsert

func (p *OrgProtos) Upsert(ctx context.Context, tx *gorm.DB) (models OrgGormModels, err error)

Upsert creates the protos using an on conflict clause to do updates. This function does not update *any* associations use gorm's association mode functions to update associations as you see fit after calling upsert. See https://gorm.io/docs/associations.html#Replace-Associations

type OrgValidationError

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

OrgValidationError is the validation error returned by Org.Validate if the designated constraints aren't met.

func (OrgValidationError) Cause

func (e OrgValidationError) Cause() error

Cause function returns cause value.

func (OrgValidationError) Error

func (e OrgValidationError) Error() string

Error satisfies the builtin error interface

func (OrgValidationError) ErrorName

func (e OrgValidationError) ErrorName() string

ErrorName returns error name.

func (OrgValidationError) Field

func (e OrgValidationError) Field() string

Field function returns field value.

func (OrgValidationError) Key

func (e OrgValidationError) Key() bool

Key function returns key value.

func (OrgValidationError) Reason

func (e OrgValidationError) Reason() string

Reason function returns reason value.

type Proto

type Proto[M Models] interface {
	GetProtoId() *string
	SetProtoId(string)
	ToModel() (M, error)
}

Proto[M Models] is an interface type that defines behavior for the implementer of a given Models type

func ConvertProtoToProtosM

func ConvertProtoToProtosM[P Protos, M Models](proto interface{}) Proto[M]

ConvertProtoToProtosM converts a single proto to a Proto[M]

func ConvertProtosToProtosM

func ConvertProtosToProtosM[P Protos, M Models](protos interface{}) []Proto[M]

ConvertProtosToProtosM converts a given slice of protos into an array of the Proto interface type, which can then leverage the interface methods

type Protos

type Protos interface {
	*Hello | *Org | *User | *Group | *Event
	GetProtoId() *string
	SetProtoId(string)
}

Protos is a union of other types that defines which types may be used in generic functions

type UnimplementedApiServer

type UnimplementedApiServer struct {
}

UnimplementedApiServer should be embedded to have forward compatible implementations.

func (UnimplementedApiServer) DeleteHellos

func (UnimplementedApiServer) GetHellos

func (UnimplementedApiServer) Healthy

func (UnimplementedApiServer) ListHellos

func (UnimplementedApiServer) Ready

func (UnimplementedApiServer) UpsertHellos

type UnsafeApiServer

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

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

type UpsertHellosRequest

type UpsertHellosRequest struct {
	Hellos []*Hello `protobuf:"bytes,1,rep,name=hellos,proto3" json:"hellos,omitempty"`
	Fields []string `protobuf:"bytes,2,rep,name=fields,proto3" json:"fields,omitempty"`
	// contains filtered or unexported fields
}

func (*UpsertHellosRequest) Descriptor deprecated

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

Deprecated: Use UpsertHellosRequest.ProtoReflect.Descriptor instead.

func (*UpsertHellosRequest) GetFields

func (x *UpsertHellosRequest) GetFields() []string

func (*UpsertHellosRequest) GetHellos

func (x *UpsertHellosRequest) GetHellos() []*Hello

func (*UpsertHellosRequest) MarshalJSON

func (msg *UpsertHellosRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*UpsertHellosRequest) ProtoMessage

func (*UpsertHellosRequest) ProtoMessage()

func (*UpsertHellosRequest) ProtoReflect

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

func (*UpsertHellosRequest) Reset

func (x *UpsertHellosRequest) Reset()

func (*UpsertHellosRequest) String

func (x *UpsertHellosRequest) String() string

func (*UpsertHellosRequest) UnmarshalJSON

func (msg *UpsertHellosRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

func (*UpsertHellosRequest) Validate

func (m *UpsertHellosRequest) Validate() error

Validate checks the field values on UpsertHellosRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*UpsertHellosRequest) ValidateAll

func (m *UpsertHellosRequest) ValidateAll() error

ValidateAll checks the field values on UpsertHellosRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in UpsertHellosRequestMultiError, or nil if none found.

type UpsertHellosRequestMultiError

type UpsertHellosRequestMultiError []error

UpsertHellosRequestMultiError is an error wrapping multiple validation errors returned by UpsertHellosRequest.ValidateAll() if the designated constraints aren't met.

func (UpsertHellosRequestMultiError) AllErrors

func (m UpsertHellosRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (UpsertHellosRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type UpsertHellosRequestValidationError

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

UpsertHellosRequestValidationError is the validation error returned by UpsertHellosRequest.Validate if the designated constraints aren't met.

func (UpsertHellosRequestValidationError) Cause

Cause function returns cause value.

func (UpsertHellosRequestValidationError) Error

Error satisfies the builtin error interface

func (UpsertHellosRequestValidationError) ErrorName

ErrorName returns error name.

func (UpsertHellosRequestValidationError) Field

Field function returns field value.

func (UpsertHellosRequestValidationError) Key

Key function returns key value.

func (UpsertHellosRequestValidationError) Reason

Reason function returns reason value.

type User

type User struct {

	// @gotags: fake:"skip"
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty" fake:"skip"`
	// @gotags: fake:"skip"
	Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty" fake:"skip"`
	// @gotags: fake:"skip"
	Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty" fake:"skip"`
	// @gotags: fake:"skip"
	GroupIds []string `protobuf:"bytes,4,rep,name=group_ids,proto3" json:"group_ids,omitempty" fake:"skip"`
	// @gotags: fake:"skip"
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,proto3" json:"created_at,omitempty" fake:"skip"`
	// @gotags: fake:"skip"
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updated_at,proto3" json:"updated_at,omitempty" fake:"skip"`
	// @gotags: fake:"skip"
	DeletedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=deleted_at,proto3" json:"deleted_at,omitempty" fake:"skip"`
	// contains filtered or unexported fields
}

func (*User) Descriptor deprecated

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

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetCreatedAt

func (x *User) GetCreatedAt() *timestamppb.Timestamp

func (*User) GetDeletedAt

func (x *User) GetDeletedAt() *timestamppb.Timestamp

func (*User) GetEmail

func (x *User) GetEmail() string

func (*User) GetGroupIds

func (x *User) GetGroupIds() []string

func (*User) GetId

func (x *User) GetId() string

func (*User) GetName

func (x *User) GetName() string

func (*User) GetProtoId

func (p *User) GetProtoId() *string

func (*User) GetUpdatedAt

func (x *User) GetUpdatedAt() *timestamppb.Timestamp

func (*User) MarshalJSON

func (msg *User) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) ProtoReflect

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

func (*User) Reset

func (x *User) Reset()

func (*User) SetProtoId

func (p *User) SetProtoId(id string)

func (*User) String

func (x *User) String() string

func (*User) ToModel

func (p *User) ToModel() (theModel *UserGormModel, err error)

func (*User) UnmarshalJSON

func (msg *User) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

func (*User) Validate

func (m *User) Validate() error

Validate checks the field values on User with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*User) ValidateAll

func (m *User) ValidateAll() error

ValidateAll checks the field values on User with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in UserMultiError, or nil if none found.

type UserGormModel

type UserGormModel struct {

	// @gotags: fake:"skip"
	Name string `json:"name" fake:"skip"`

	// @gotags: fake:"skip"
	Id string `gorm:"type:uuid;primaryKey;default:uuid_generate_v4();" json:"id" fake:"skip"`

	// @gotags: fake:"skip"
	Email string `json:"email" fake:"skip"`

	// @gotags: fake:"skip"
	GroupIds pq.StringArray `gorm:"type:text[];" json:"group_ids" fake:"skip"`

	// @gotags: fake:"skip"
	CreatedAt *time.Time `gorm:"type:timestamp;" json:"created_at" fake:"skip"`

	// @gotags: fake:"skip"
	UpdatedAt *time.Time `gorm:"type:timestamp;" json:"updated_at" fake:"skip"`

	// @gotags: fake:"skip"
	DeletedAt *time.Time `gorm:"type:timestamp;" json:"deleted_at" fake:"skip"`
}

func (*UserGormModel) GetModelId

func (m *UserGormModel) GetModelId() *string

func (*UserGormModel) New

func (m *UserGormModel) New() interface{}

func (*UserGormModel) SetModelId

func (m *UserGormModel) SetModelId(id string)

func (*UserGormModel) TableName

func (m *UserGormModel) TableName() string

func (*UserGormModel) ToProto

func (m *UserGormModel) ToProto() (theProto *User, err error)

type UserGormModels

type UserGormModels []*UserGormModel

func (UserGormModels) GetByModelIds

func (m UserGormModels) GetByModelIds(ctx context.Context, tx *gorm.DB, preloads ...string) (err error)

func (UserGormModels) ToProtos

func (m UserGormModels) ToProtos() (protos UserProtos, err error)

type UserMultiError

type UserMultiError []error

UserMultiError is an error wrapping multiple validation errors returned by User.ValidateAll() if the designated constraints aren't met.

func (UserMultiError) AllErrors

func (m UserMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (UserMultiError) Error

func (m UserMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type UserProtos

type UserProtos []*User

func (*UserProtos) GetByIds

func (p *UserProtos) GetByIds(ctx context.Context, tx *gorm.DB, ids []string, preloads ...string) (err error)

func (*UserProtos) List

func (p *UserProtos) List(ctx context.Context, tx *gorm.DB, limit, offset int, order interface{}, preloads ...string) (err error)

func (UserProtos) ToModels

func (p UserProtos) ToModels() (models UserGormModels, err error)

func (*UserProtos) Upsert

func (p *UserProtos) Upsert(ctx context.Context, tx *gorm.DB) (models UserGormModels, err error)

Upsert creates the protos using an on conflict clause to do updates. This function does not update *any* associations use gorm's association mode functions to update associations as you see fit after calling upsert. See https://gorm.io/docs/associations.html#Replace-Associations

type UserValidationError

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

UserValidationError is the validation error returned by User.Validate if the designated constraints aren't met.

func (UserValidationError) Cause

func (e UserValidationError) Cause() error

Cause function returns cause value.

func (UserValidationError) Error

func (e UserValidationError) Error() string

Error satisfies the builtin error interface

func (UserValidationError) ErrorName

func (e UserValidationError) ErrorName() string

ErrorName returns error name.

func (UserValidationError) Field

func (e UserValidationError) Field() string

Field function returns field value.

func (UserValidationError) Key

func (e UserValidationError) Key() bool

Key function returns key value.

func (UserValidationError) Reason

func (e UserValidationError) Reason() string

Reason function returns reason value.

Jump to

Keyboard shortcuts

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