gormpb

package module
v0.0.0-...-b16e635 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 5 Imported by: 3

README

About

A minimal Go module imported by your generated Go code when using options.proto.

go get github.com/complex64/protoc-gen-gorm/gormpb

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TimeType_name = map[int32]string{
		0: "GO_TIME_TIME",
		1: "SECONDS",
		2: "MILLISECONDS",
		3: "NANOSECONDS",
	}
	TimeType_value = map[string]int32{
		"GO_TIME_TIME": 0,
		"SECONDS":      1,
		"MILLISECONDS": 2,
		"NANOSECONDS":  3,
	}
)

Enum value maps for TimeType.

View Source
var (
	// optional gorm.EnumOptions enum = 50104;
	E_Enum = &file_gorm_options_proto_extTypes[4]
)

Extension fields to descriptorpb.EnumOptions.

View Source
var (
	// optional gorm.EnumValueOptions enum_value = 50105;
	E_EnumValue = &file_gorm_options_proto_extTypes[5]
)

Extension fields to descriptorpb.EnumValueOptions.

View Source
var (
	// optional gorm.FieldOptions field = 50102;
	E_Field = &file_gorm_options_proto_extTypes[2]
)

Extension fields to descriptorpb.FieldOptions.

View Source
var (
	// optional gorm.FileOptions file = 50100;
	E_File = &file_gorm_options_proto_extTypes[0]
)

Extension fields to descriptorpb.FileOptions.

View Source
var (
	// optional gorm.MessageOptions message = 50101;
	E_Message = &file_gorm_options_proto_extTypes[1]
)

Extension fields to descriptorpb.MessageOptions.

View Source
var (
	// optional gorm.MethodOptions method = 50107;
	E_Method = &file_gorm_options_proto_extTypes[7]
)

Extension fields to descriptorpb.MethodOptions.

View Source
var (
	// optional gorm.OneofOptions oneof = 50103;
	E_Oneof = &file_gorm_options_proto_extTypes[3]
)

Extension fields to descriptorpb.OneofOptions.

View Source
var (
	// optional gorm.ServiceOptions service = 50106;
	E_Service = &file_gorm_options_proto_extTypes[6]
)

Extension fields to descriptorpb.ServiceOptions.

View Source
var File_gorm_options_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type EnumOptions

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

func (*EnumOptions) Descriptor deprecated

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

Deprecated: Use EnumOptions.ProtoReflect.Descriptor instead.

func (*EnumOptions) ProtoMessage

func (*EnumOptions) ProtoMessage()

func (*EnumOptions) ProtoReflect

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

func (*EnumOptions) Reset

func (x *EnumOptions) Reset()

func (*EnumOptions) String

func (x *EnumOptions) String() string

type EnumValueOptions

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

func (*EnumValueOptions) Descriptor deprecated

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

Deprecated: Use EnumValueOptions.ProtoReflect.Descriptor instead.

func (*EnumValueOptions) ProtoMessage

func (*EnumValueOptions) ProtoMessage()

func (*EnumValueOptions) ProtoReflect

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

func (*EnumValueOptions) Reset

func (x *EnumValueOptions) Reset()

func (*EnumValueOptions) String

func (x *EnumValueOptions) String() string

type FieldOptions

type FieldOptions struct {

	// Name of the column in the database.
	Column string `protobuf:"bytes,1,opt,name=column,proto3" json:"column,omitempty"`
	// The field must not be null.
	NotNull bool `protobuf:"varint,6,opt,name=not_null,json=notNull,proto3" json:"not_null,omitempty"`
	// Use this default value for this column.
	// Note that zero values (0, "", false) are not supported by GORM.
	Default string `protobuf:"bytes,7,opt,name=default,proto3" json:"default,omitempty"`
	// Require the column's data to be unique among all the rows in the table.
	Unique bool `protobuf:"varint,8,opt,name=unique,proto3" json:"unique,omitempty"`
	// Mark the column as primary key.
	// Multiple primary keys create a composite primary key.
	// Implies auto_increment=true for integer columns.
	PrimaryKey bool     `protobuf:"varint,9,opt,name=primary_key,json=primaryKey,proto3" json:"primary_key,omitempty"`
	Index      []*Index `protobuf:"bytes,10,rep,name=index,proto3" json:"index,omitempty"`
	// Let the index enforce uniqueness of the column's value.
	UniqueIndex []*Index `protobuf:"bytes,11,rep,name=unique_index,json=uniqueIndex,proto3" json:"unique_index,omitempty"`
	// Let this field track the creation time as time.Time.
	AutoCreateTime bool `protobuf:"varint,14,opt,name=auto_create_time,json=autoCreateTime,proto3" json:"auto_create_time,omitempty"`
	// Let this field track the update time as time.Time.
	AutoUpdateTime bool `protobuf:"varint,16,opt,name=auto_update_time,json=autoUpdateTime,proto3" json:"auto_update_time,omitempty"`
	// Types that are assignable to Permissions:
	//
	//	*FieldOptions_Ignore
	//	*FieldOptions_Deny
	Permissions isFieldOptions_Permissions `protobuf_oneof:"permissions"`
	// Custom types: Inline as JSON.
	Json bool `protobuf:"varint,25,opt,name=json,proto3" json:"json,omitempty"`
	// contains filtered or unexported fields
}

func (*FieldOptions) Descriptor deprecated

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

Deprecated: Use FieldOptions.ProtoReflect.Descriptor instead.

func (*FieldOptions) GetAutoCreateTime

func (x *FieldOptions) GetAutoCreateTime() bool

func (*FieldOptions) GetAutoUpdateTime

func (x *FieldOptions) GetAutoUpdateTime() bool

func (*FieldOptions) GetColumn

func (x *FieldOptions) GetColumn() string

func (*FieldOptions) GetDefault

func (x *FieldOptions) GetDefault() string

func (*FieldOptions) GetDeny

func (x *FieldOptions) GetDeny() *FieldPermissionsDenyList

func (*FieldOptions) GetIgnore

func (x *FieldOptions) GetIgnore() bool

func (*FieldOptions) GetIndex

func (x *FieldOptions) GetIndex() []*Index

func (*FieldOptions) GetJson

func (x *FieldOptions) GetJson() bool

func (*FieldOptions) GetNotNull

func (x *FieldOptions) GetNotNull() bool

func (*FieldOptions) GetPermissions

func (m *FieldOptions) GetPermissions() isFieldOptions_Permissions

func (*FieldOptions) GetPrimaryKey

func (x *FieldOptions) GetPrimaryKey() bool

func (*FieldOptions) GetUnique

func (x *FieldOptions) GetUnique() bool

func (*FieldOptions) GetUniqueIndex

func (x *FieldOptions) GetUniqueIndex() []*Index

func (*FieldOptions) ProtoMessage

func (*FieldOptions) ProtoMessage()

func (*FieldOptions) ProtoReflect

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

func (*FieldOptions) Reset

func (x *FieldOptions) Reset()

func (*FieldOptions) String

func (x *FieldOptions) String() string

type FieldOptions_Deny

type FieldOptions_Deny struct {
	Deny *FieldPermissionsDenyList `protobuf:"bytes,23,opt,name=deny,proto3,oneof"`
}

type FieldOptions_Ignore

type FieldOptions_Ignore struct {
	// Equivalent to gorm:"-"
	Ignore bool `protobuf:"varint,22,opt,name=ignore,proto3,oneof"`
}

type FieldPermissionsDenyList

type FieldPermissionsDenyList struct {

	// Deny creation, allow updates.
	// Equivalent to gorm:"<-:update".
	Create bool `protobuf:"varint,2,opt,name=create,proto3" json:"create,omitempty"`
	// Deny updates, allow creation.
	// Equivalent to gorm:"<-:create".
	Update bool `protobuf:"varint,3,opt,name=update,proto3" json:"update,omitempty"`
	// Deny reads.
	// Equivalent to gorm:"->:false".
	Read bool `protobuf:"varint,4,opt,name=read,proto3" json:"read,omitempty"`
	// contains filtered or unexported fields
}

func (*FieldPermissionsDenyList) Descriptor deprecated

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

Deprecated: Use FieldPermissionsDenyList.ProtoReflect.Descriptor instead.

func (*FieldPermissionsDenyList) GetCreate

func (x *FieldPermissionsDenyList) GetCreate() bool

func (*FieldPermissionsDenyList) GetRead

func (x *FieldPermissionsDenyList) GetRead() bool

func (*FieldPermissionsDenyList) GetUpdate

func (x *FieldPermissionsDenyList) GetUpdate() bool

func (*FieldPermissionsDenyList) ProtoMessage

func (*FieldPermissionsDenyList) ProtoMessage()

func (*FieldPermissionsDenyList) ProtoReflect

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

func (*FieldPermissionsDenyList) Reset

func (x *FieldPermissionsDenyList) Reset()

func (*FieldPermissionsDenyList) String

func (x *FieldPermissionsDenyList) String() string

type FileOptions

type FileOptions struct {

	// Set model=true for all messages.
	Model bool `protobuf:"varint,1,opt,name=model,proto3" json:"model,omitempty"`
	// Set validate=true for all messages.
	Validate bool `protobuf:"varint,3,opt,name=validate,proto3" json:"validate,omitempty"`
	// Set crud=true for all messages.
	Crud bool `protobuf:"varint,4,opt,name=crud,proto3" json:"crud,omitempty"`
	// contains filtered or unexported fields
}

func (*FileOptions) Descriptor deprecated

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

Deprecated: Use FileOptions.ProtoReflect.Descriptor instead.

func (*FileOptions) GetCrud

func (x *FileOptions) GetCrud() bool

func (*FileOptions) GetModel

func (x *FileOptions) GetModel() bool

func (*FileOptions) GetValidate

func (x *FileOptions) GetValidate() bool

func (*FileOptions) ProtoMessage

func (*FileOptions) ProtoMessage()

func (*FileOptions) ProtoReflect

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

func (*FileOptions) Reset

func (x *FileOptions) Reset()

func (*FileOptions) String

func (x *FileOptions) String() string

type Index

type Index struct {

	// Generate the default index.
	// Equivalent to gorm:"index"`.
	Default bool `protobuf:"varint,1,opt,name=default,proto3" json:"default,omitempty"`
	// Set the index name.
	// Equivalent to gorm:"index:<name>"`.
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*Index) Descriptor deprecated

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

Deprecated: Use Index.ProtoReflect.Descriptor instead.

func (*Index) GetDefault

func (x *Index) GetDefault() bool

func (*Index) GetName

func (x *Index) GetName() string

func (*Index) ProtoMessage

func (*Index) ProtoMessage()

func (*Index) ProtoReflect

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

func (*Index) Reset

func (x *Index) Reset()

func (*Index) String

func (x *Index) String() string

type MessageOptions

type MessageOptions struct {

	// Generate a GORM model for this message.
	Model bool `protobuf:"varint,1,opt,name=model,proto3" json:"model,omitempty"`
	// Validate the model before saving.
	// Expects usage of https://github.com/envoyproxy/protoc-gen-validate.
	// Implies model=true.
	Validate bool `protobuf:"varint,3,opt,name=validate,proto3" json:"validate,omitempty"`
	// Generate functions to create, read, update, and delete (CRUD) objects.
	// Implies model=true.
	Crud bool `protobuf:"varint,4,opt,name=crud,proto3" json:"crud,omitempty"`
	// Override the table name.
	Table string `protobuf:"bytes,5,opt,name=table,proto3" json:"table,omitempty"`
	// contains filtered or unexported fields
}

func (*MessageOptions) Descriptor deprecated

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

Deprecated: Use MessageOptions.ProtoReflect.Descriptor instead.

func (*MessageOptions) GetCrud

func (x *MessageOptions) GetCrud() bool

func (*MessageOptions) GetModel

func (x *MessageOptions) GetModel() bool

func (*MessageOptions) GetTable

func (x *MessageOptions) GetTable() string

func (*MessageOptions) GetValidate

func (x *MessageOptions) GetValidate() bool

func (*MessageOptions) ProtoMessage

func (*MessageOptions) ProtoMessage()

func (*MessageOptions) ProtoReflect

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

func (*MessageOptions) Reset

func (x *MessageOptions) Reset()

func (*MessageOptions) String

func (x *MessageOptions) String() string

type MethodOptions

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

func (*MethodOptions) Descriptor deprecated

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

Deprecated: Use MethodOptions.ProtoReflect.Descriptor instead.

func (*MethodOptions) ProtoMessage

func (*MethodOptions) ProtoMessage()

func (*MethodOptions) ProtoReflect

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

func (*MethodOptions) Reset

func (x *MethodOptions) Reset()

func (*MethodOptions) String

func (x *MethodOptions) String() string

type OneofOptions

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

func (*OneofOptions) Descriptor deprecated

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

Deprecated: Use OneofOptions.ProtoReflect.Descriptor instead.

func (*OneofOptions) ProtoMessage

func (*OneofOptions) ProtoMessage()

func (*OneofOptions) ProtoReflect

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

func (*OneofOptions) Reset

func (x *OneofOptions) Reset()

func (*OneofOptions) String

func (x *OneofOptions) String() string

type ServiceOptions

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

func (*ServiceOptions) Descriptor deprecated

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

Deprecated: Use ServiceOptions.ProtoReflect.Descriptor instead.

func (*ServiceOptions) ProtoMessage

func (*ServiceOptions) ProtoMessage()

func (*ServiceOptions) ProtoReflect

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

func (*ServiceOptions) Reset

func (x *ServiceOptions) Reset()

func (*ServiceOptions) String

func (x *ServiceOptions) String() string

type TimeType

type TimeType int32
const (
	// Default. Store times as Go's time.Time.
	TimeType_GO_TIME_TIME TimeType = 0
	// Store times as integers instead of time.Time.
	TimeType_SECONDS      TimeType = 1
	TimeType_MILLISECONDS TimeType = 2
	TimeType_NANOSECONDS  TimeType = 3
)

func (TimeType) Descriptor

func (TimeType) Descriptor() protoreflect.EnumDescriptor

func (TimeType) Enum

func (x TimeType) Enum() *TimeType

func (TimeType) EnumDescriptor deprecated

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

Deprecated: Use TimeType.Descriptor instead.

func (TimeType) Number

func (x TimeType) Number() protoreflect.EnumNumber

func (TimeType) String

func (x TimeType) String() string

func (TimeType) Type

Jump to

Keyboard shortcuts

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