crud

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_crud_crud_proto protoreflect.FileDescriptor

Functions

func LookupCrudModelColumn

func LookupCrudModelColumn(field string) string

func LookupCrudModelColumns

func LookupCrudModelColumns(paths []string) (cols []string)

Types

type Crud

type Crud struct {
	Uuid        string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
	StringField string `protobuf:"bytes,2,opt,name=string_field,json=stringField,proto3" json:"string_field,omitempty"`
	Int32Field  int32  `protobuf:"varint,3,opt,name=int32_field,json=int32Field,proto3" json:"int32_field,omitempty"`
	BoolField   bool   `protobuf:"varint,4,opt,name=bool_field,json=boolField,proto3" json:"bool_field,omitempty"`
	// contains filtered or unexported fields
}

func (*Crud) AsModel

func (x *Crud) AsModel() (*CrudModel, error)

AsModel converts a Crud to its GORM model.

func (*Crud) Descriptor deprecated

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

Deprecated: Use Crud.ProtoReflect.Descriptor instead.

func (*Crud) GetBoolField

func (x *Crud) GetBoolField() bool

func (*Crud) GetInt32Field

func (x *Crud) GetInt32Field() int32

func (*Crud) GetStringField

func (x *Crud) GetStringField() string

func (*Crud) GetUuid

func (x *Crud) GetUuid() string

func (*Crud) ProtoMessage

func (*Crud) ProtoMessage()

func (*Crud) ProtoReflect

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

func (*Crud) Reset

func (x *Crud) Reset()

func (*Crud) String

func (x *Crud) String() string

func (*Crud) WithDB

func (x *Crud) WithDB(db *gorm.DB) CrudWithDB

type CrudGetOption

type CrudGetOption func(tx *gorm.DB) *gorm.DB

func WithCrudGetFieldMask

func WithCrudGetFieldMask(mask *fieldmaskpb.FieldMask) CrudGetOption

type CrudListOption

type CrudListOption func(tx *gorm.DB) *gorm.DB

func WithCrudListFieldMask

func WithCrudListFieldMask(mask *fieldmaskpb.FieldMask) CrudListOption

func WithCrudListFilter

func WithCrudListFilter(filter string) CrudListOption

func WithCrudListLimit

func WithCrudListLimit(n int) CrudListOption

func WithCrudListOffset

func WithCrudListOffset(n int) CrudListOption

func WithCrudListOrder

func WithCrudListOrder(order string) CrudListOption

type CrudModel

type CrudModel struct {
	Uuid        string `gorm:"primaryKey"`
	StringField string
	Int32Field  int32
	BoolField   bool `gorm:"column:enabled"`
}

CrudModel is the GORM model for crud.Crud.

func (*CrudModel) AsProto

func (m *CrudModel) AsProto() (*Crud, error)

AsProto converts a CrudModel to its protobuf representation.

type CrudWithDB

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

func (CrudWithDB) Create

func (c CrudWithDB) Create(ctx context.Context) (*Crud, error)

func (CrudWithDB) Delete

func (c CrudWithDB) Delete(ctx context.Context) error

func (CrudWithDB) Get

func (c CrudWithDB) Get(ctx context.Context, opts ...CrudGetOption) (*Crud, error)

func (CrudWithDB) List

func (c CrudWithDB) List(ctx context.Context, opts ...CrudListOption) ([]*Crud, error)

func (CrudWithDB) Patch

func (c CrudWithDB) Patch(ctx context.Context, mask *fieldmaskpb.FieldMask) error

func (CrudWithDB) Update

func (c CrudWithDB) Update(ctx context.Context) (*Crud, error)

Jump to

Keyboard shortcuts

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