proto

package
v0.388.0-next.3 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ActionImplementation_name = map[int32]string{
		0: "ACTION_IMPLEMENTATION_UNKNOWN",
		1: "ACTION_IMPLEMENTATION_AUTO",
		2: "ACTION_IMPLEMENTATION_CUSTOM",
		3: "ACTION_IMPLEMENTATION_RUNTIME",
	}
	ActionImplementation_value = map[string]int32{
		"ACTION_IMPLEMENTATION_UNKNOWN": 0,
		"ACTION_IMPLEMENTATION_AUTO":    1,
		"ACTION_IMPLEMENTATION_CUSTOM":  2,
		"ACTION_IMPLEMENTATION_RUNTIME": 3,
	}
)

Enum value maps for ActionImplementation.

View Source
var (
	ActionType_name = map[int32]string{
		0: "ACTION_TYPE_UNKNOWN",
		1: "ACTION_TYPE_CREATE",
		2: "ACTION_TYPE_GET",
		3: "ACTION_TYPE_LIST",
		4: "ACTION_TYPE_UPDATE",
		5: "ACTION_TYPE_DELETE",
		6: "ACTION_TYPE_READ",
		7: "ACTION_TYPE_WRITE",
	}
	ActionType_value = map[string]int32{
		"ACTION_TYPE_UNKNOWN": 0,
		"ACTION_TYPE_CREATE":  1,
		"ACTION_TYPE_GET":     2,
		"ACTION_TYPE_LIST":    3,
		"ACTION_TYPE_UPDATE":  4,
		"ACTION_TYPE_DELETE":  5,
		"ACTION_TYPE_READ":    6,
		"ACTION_TYPE_WRITE":   7,
	}
)

Enum value maps for ActionType.

View Source
var (
	Type_name = map[int32]string{
		0:  "TYPE_UNKNOWN",
		1:  "TYPE_STRING",
		2:  "TYPE_BOOL",
		3:  "TYPE_INT",
		4:  "TYPE_TIMESTAMP",
		5:  "TYPE_DATE",
		6:  "TYPE_ID",
		7:  "TYPE_MODEL",
		8:  "TYPE_CURRENCY",
		9:  "TYPE_DATETIME",
		10: "TYPE_ENUM",
		12: "TYPE_IMAGE",
		13: "TYPE_OBJECT",
		14: "TYPE_SECRET",
		15: "TYPE_PASSWORD",
		16: "TYPE_MESSAGE",
		17: "TYPE_ANY",
		18: "TYPE_SORT_DIRECTION",
		19: "TYPE_UNION",
		20: "TYPE_STRING_LITERAL",
		21: "TYPE_MARKDOWN",
		22: "TYPE_DECIMAL",
		23: "TYPE_VECTOR",
		24: "TYPE_INLINE_FILE",
	}
	Type_value = map[string]int32{
		"TYPE_UNKNOWN":        0,
		"TYPE_STRING":         1,
		"TYPE_BOOL":           2,
		"TYPE_INT":            3,
		"TYPE_TIMESTAMP":      4,
		"TYPE_DATE":           5,
		"TYPE_ID":             6,
		"TYPE_MODEL":          7,
		"TYPE_CURRENCY":       8,
		"TYPE_DATETIME":       9,
		"TYPE_ENUM":           10,
		"TYPE_IMAGE":          12,
		"TYPE_OBJECT":         13,
		"TYPE_SECRET":         14,
		"TYPE_PASSWORD":       15,
		"TYPE_MESSAGE":        16,
		"TYPE_ANY":            17,
		"TYPE_SORT_DIRECTION": 18,
		"TYPE_UNION":          19,
		"TYPE_STRING_LITERAL": 20,
		"TYPE_MARKDOWN":       21,
		"TYPE_DECIMAL":        22,
		"TYPE_VECTOR":         23,
		"TYPE_INLINE_FILE":    24,
	}
)

Enum value maps for Type.

View Source
var (
	OrderDirection_name = map[int32]string{
		0: "ORDER_DIRECTION_UNKNOWN",
		1: "ORDER_DIRECTION_ASCENDING",
		2: "ORDER_DIRECTION_DECENDING",
	}
	OrderDirection_value = map[string]int32{
		"ORDER_DIRECTION_UNKNOWN":   0,
		"ORDER_DIRECTION_ASCENDING": 1,
		"ORDER_DIRECTION_DECENDING": 2,
	}
)

Enum value maps for OrderDirection.

View Source
var File_proto_schema_proto protoreflect.FileDescriptor

Functions

func ActionIsArbitraryFunction

func ActionIsArbitraryFunction(action *Action) bool

func ActionIsFunction

func ActionIsFunction(action *Action) bool

func EnumExists

func EnumExists(enums []*Enum, name string) bool

EnumExists returns true if the given schema contains a enum with the given name.

func FieldNames

func FieldNames(m *Model) []string

FieldNames provides a (sorted) list of the fields in the model of the given name.

func GetActionNamesForApi

func GetActionNamesForApi(p *Schema, api *Api) []string

GetActionNamesForApi returns all the actions available on an API.

func GetForeignKeyFieldName added in v0.388.0

func GetForeignKeyFieldName(models []*Model, field *Field) string

GetForeignKeyFieldName returns the foreign key field name for the given field if it represents a relationship to another model. It returns an empty string if field's type is not a model. The foreign key returned might exists on field's parent model, or on the model field it is related to, so this function would normally be used in conjunction with IsBelongsTo or it's counterparts to determine on which side the foreign key lives

func IsBelongsTo

func IsBelongsTo(field *Field) bool

func IsHasMany

func IsHasMany(field *Field) bool

func IsHasOne

func IsHasOne(field *Field) bool

func IsReadAction

func IsReadAction(action *Action) bool

func IsRepeated

func IsRepeated(field *Field) bool

IsTypeRepeated returns true if the field is specified as being "repeated".

func IsTypeModel

func IsTypeModel(field *Field) bool

IsTypeModel returns true of the field's type is Model.

func IsWriteAction

func IsWriteAction(action *Action) bool

func MessageUsedAsResponse

func MessageUsedAsResponse(schema *Schema, msgName string) bool

func ModelExists

func ModelExists(models []*Model, name string) bool

ModelsExists returns true if the given schema contains a model with the given name.

func ModelHasField

func ModelHasField(schema *Schema, model string, field string) bool

ModelHasField returns true IF the schema contains a model of the given name AND that model has a field of the given name.

func ModelNames

func ModelNames(p *Schema) []string

ModelNames provides a (sorted) list of all the Model names used in the given schema.

func PrimaryKeyFieldName

func PrimaryKeyFieldName(model *Model) string

PrimaryKeyFieldName returns the name of the field in the given model, that is marked as being the model's primary key. (Or empty string).

Types

type Action

type Action struct {

	// The name of the model this action belongs to.
	ModelName string `protobuf:"bytes,1,opt,name=model_name,json=modelName,proto3" json:"model_name,omitempty"`
	// The name of the action. Must be in lowerCamelCase and be unique across all actions
	// across all models within the schema. This is because in both RPC and GraphQL actions
	// are top-level and so two different models can't both define an actions with the same name.
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// The type of this action.
	Type ActionType `protobuf:"varint,3,opt,name=type,proto3,enum=proto.ActionType" json:"type,omitempty"`
	// Whether this action will be auto-generated by Keel or implemented with a function.
	Implementation ActionImplementation `protobuf:"varint,4,opt,name=implementation,proto3,enum=proto.ActionImplementation" json:"implementation,omitempty"`
	// A list of permission rules to apply to this action
	Permissions []*PermissionRule `protobuf:"bytes,6,rep,name=permissions,proto3" json:"permissions,omitempty"`
	// A list of assignment expression to be executed as part of this action.
	// Only valid in `type` is ACTION_TYPE_CREATE or ACTION_TYPE_UPDATE
	SetExpressions []*Expression `protobuf:"bytes,7,rep,name=set_expressions,json=setExpressions,proto3" json:"set_expressions,omitempty"`
	// A list of logical expressions to be applied to the database query being
	// executed as part of the action.
	// Not valid if `type` is ACTION_TYPE_CREATE
	// If there are multiple entries in this field they are AND'd.
	WhereExpressions []*Expression `protobuf:"bytes,8,rep,name=where_expressions,json=whereExpressions,proto3" json:"where_expressions,omitempty"`
	// A list of expressions that perform some kind of validation (likely on the inputs).
	ValidationExpressions []*Expression `protobuf:"bytes,9,rep,name=validation_expressions,json=validationExpressions,proto3" json:"validation_expressions,omitempty"`
	// A ordered list of order by statements.
	OrderBy []*OrderByStatement `protobuf:"bytes,10,rep,name=order_by,json=orderBy,proto3" json:"order_by,omitempty"`
	// The name of the input message type for this action.
	InputMessageName string `protobuf:"bytes,11,opt,name=input_message_name,json=inputMessageName,proto3" json:"input_message_name,omitempty"`
	// The name of the response message type for this action when not a built-in action. This is because
	// built-in action responses are determined by the action type (get, list, create, update, delete).
	ResponseMessageName string `protobuf:"bytes,12,opt,name=response_message_name,json=responseMessageName,proto3" json:"response_message_name,omitempty"`
	// Embedded data can be attached to the response message of built in actions (get, list).
	ResponseEmbeds []string `protobuf:"bytes,13,rep,name=response_embeds,json=responseEmbeds,proto3" json:"response_embeds,omitempty"`
	// contains filtered or unexported fields
}

func FilterActions

func FilterActions(p *Schema, filter func(op *Action) bool) (ops []*Action)

func FindAction

func FindAction(schema *Schema, actionName string) *Action

func (*Action) Descriptor deprecated

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

Deprecated: Use Action.ProtoReflect.Descriptor instead.

func (*Action) GetImplementation

func (x *Action) GetImplementation() ActionImplementation

func (*Action) GetInputMessageName

func (x *Action) GetInputMessageName() string

func (*Action) GetModelName

func (x *Action) GetModelName() string

func (*Action) GetName

func (x *Action) GetName() string

func (*Action) GetOrderBy

func (x *Action) GetOrderBy() []*OrderByStatement

func (*Action) GetPermissions

func (x *Action) GetPermissions() []*PermissionRule

func (*Action) GetResponseEmbeds added in v0.388.0

func (x *Action) GetResponseEmbeds() []string

func (*Action) GetResponseMessageName

func (x *Action) GetResponseMessageName() string

func (*Action) GetSetExpressions

func (x *Action) GetSetExpressions() []*Expression

func (*Action) GetType

func (x *Action) GetType() ActionType

func (*Action) GetValidationExpressions

func (x *Action) GetValidationExpressions() []*Expression

func (*Action) GetWhereExpressions

func (x *Action) GetWhereExpressions() []*Expression

func (*Action) ProtoMessage

func (*Action) ProtoMessage()

func (*Action) ProtoReflect

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

func (*Action) Reset

func (x *Action) Reset()

func (*Action) String

func (x *Action) String() string

type ActionImplementation

type ActionImplementation int32

Describes where and by which party the implementation for an action is provided.

const (
	ActionImplementation_ACTION_IMPLEMENTATION_UNKNOWN ActionImplementation = 0
	// Auto means the implementation of the action is generated by Keel based on the
	// specified action type (get, create, update, list, delete)
	ActionImplementation_ACTION_IMPLEMENTATION_AUTO ActionImplementation = 1
	// Custom means the implementation of the action is provided via custom functions code.
	// The code itself is not represented in this proto schema.
	ActionImplementation_ACTION_IMPLEMENTATION_CUSTOM ActionImplementation = 2
	// Runtime means the implementation of the action is provided in the runtime code.
	ActionImplementation_ACTION_IMPLEMENTATION_RUNTIME ActionImplementation = 3
)

func (ActionImplementation) Descriptor

func (ActionImplementation) Enum

func (ActionImplementation) EnumDescriptor deprecated

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

Deprecated: Use ActionImplementation.Descriptor instead.

func (ActionImplementation) Number

func (ActionImplementation) String

func (x ActionImplementation) String() string

func (ActionImplementation) Type

type ActionType

type ActionType int32

Describes the behaviour of an action and a preordained input and output specification.

const (
	ActionType_ACTION_TYPE_UNKNOWN ActionType = 0
	// Creates a new record and returns it.
	ActionType_ACTION_TYPE_CREATE ActionType = 1
	// Returns a single record by looking up on a unique field.
	ActionType_ACTION_TYPE_GET ActionType = 2
	// Lists records optionally filtering on certain fields. The response would be a
	// an object that supports pagination functionality and contains a "page" of results.
	ActionType_ACTION_TYPE_LIST ActionType = 3
	// Update a single record by providing a unique lookup and some fields to update.
	// The resulting record is returned.
	ActionType_ACTION_TYPE_UPDATE ActionType = 4
	// Delete a record and returns it's ID.
	ActionType_ACTION_TYPE_DELETE ActionType = 5
	// A generic read action.
	ActionType_ACTION_TYPE_READ ActionType = 6
	// A generic write action.
	ActionType_ACTION_TYPE_WRITE ActionType = 7
)

func (ActionType) Descriptor

func (ActionType) Descriptor() protoreflect.EnumDescriptor

func (ActionType) Enum

func (x ActionType) Enum() *ActionType

func (ActionType) EnumDescriptor deprecated

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

Deprecated: Use ActionType.Descriptor instead.

func (ActionType) Number

func (x ActionType) Number() protoreflect.EnumNumber

func (ActionType) String

func (x ActionType) String() string

func (ActionType) Type

type Api

type Api struct {
	Name      string      `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	ApiModels []*ApiModel `protobuf:"bytes,3,rep,name=api_models,json=apiModels,proto3" json:"api_models,omitempty"`
	// contains filtered or unexported fields
}

func FindApi added in v0.376.0

func FindApi(s *Schema, name string) *Api

FindApi locates the API of the given name.

func (*Api) Descriptor deprecated

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

Deprecated: Use Api.ProtoReflect.Descriptor instead.

func (*Api) GetApiModels

func (x *Api) GetApiModels() []*ApiModel

func (*Api) GetName

func (x *Api) GetName() string

func (*Api) ProtoMessage

func (*Api) ProtoMessage()

func (*Api) ProtoReflect

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

func (*Api) Reset

func (x *Api) Reset()

func (*Api) String

func (x *Api) String() string

type ApiModel

type ApiModel struct {
	ModelName    string            `protobuf:"bytes,1,opt,name=model_name,json=modelName,proto3" json:"model_name,omitempty"`
	ModelActions []*ApiModelAction `protobuf:"bytes,2,rep,name=model_actions,json=modelActions,proto3" json:"model_actions,omitempty"`
	// contains filtered or unexported fields
}

func (*ApiModel) Descriptor deprecated

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

Deprecated: Use ApiModel.ProtoReflect.Descriptor instead.

func (*ApiModel) GetModelActions added in v0.377.0

func (x *ApiModel) GetModelActions() []*ApiModelAction

func (*ApiModel) GetModelName

func (x *ApiModel) GetModelName() string

func (*ApiModel) ProtoMessage

func (*ApiModel) ProtoMessage()

func (*ApiModel) ProtoReflect

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

func (*ApiModel) Reset

func (x *ApiModel) Reset()

func (*ApiModel) String

func (x *ApiModel) String() string

type ApiModelAction added in v0.377.0

type ApiModelAction struct {
	ActionName string `protobuf:"bytes,1,opt,name=action_name,json=actionName,proto3" json:"action_name,omitempty"`
	// contains filtered or unexported fields
}

func (*ApiModelAction) Descriptor deprecated added in v0.377.0

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

Deprecated: Use ApiModelAction.ProtoReflect.Descriptor instead.

func (*ApiModelAction) GetActionName added in v0.377.0

func (x *ApiModelAction) GetActionName() string

func (*ApiModelAction) ProtoMessage added in v0.377.0

func (*ApiModelAction) ProtoMessage()

func (*ApiModelAction) ProtoReflect added in v0.377.0

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

func (*ApiModelAction) Reset added in v0.377.0

func (x *ApiModelAction) Reset()

func (*ApiModelAction) String added in v0.377.0

func (x *ApiModelAction) String() string

type DefaultValue

type DefaultValue struct {

	// If true then a "zero" value is used for the field, for example
	// a string has a zero value of "" and a date has a zero value of
	// today
	UseZeroValue bool `protobuf:"varint,1,opt,name=use_zero_value,json=useZeroValue,proto3" json:"use_zero_value,omitempty"`
	// This can be used to explicitly set the default value
	Expression *Expression `protobuf:"bytes,2,opt,name=expression,proto3" json:"expression,omitempty"`
	// contains filtered or unexported fields
}

func (*DefaultValue) Descriptor deprecated

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

Deprecated: Use DefaultValue.ProtoReflect.Descriptor instead.

func (*DefaultValue) GetExpression

func (x *DefaultValue) GetExpression() *Expression

func (*DefaultValue) GetUseZeroValue

func (x *DefaultValue) GetUseZeroValue() bool

func (*DefaultValue) ProtoMessage

func (*DefaultValue) ProtoMessage()

func (*DefaultValue) ProtoReflect

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

func (*DefaultValue) Reset

func (x *DefaultValue) Reset()

func (*DefaultValue) String

func (x *DefaultValue) String() string

type Enum

type Enum struct {
	Name   string       `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Values []*EnumValue `protobuf:"bytes,2,rep,name=values,proto3" json:"values,omitempty"`
	// contains filtered or unexported fields
}

func FindEnum

func FindEnum(enums []*Enum, name string) *Enum

FindEnum locates the enum of the given name.

func (*Enum) Descriptor deprecated

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

Deprecated: Use Enum.ProtoReflect.Descriptor instead.

func (*Enum) GetName

func (x *Enum) GetName() string

func (*Enum) GetValues

func (x *Enum) GetValues() []*EnumValue

func (*Enum) ProtoMessage

func (*Enum) ProtoMessage()

func (*Enum) ProtoReflect

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

func (*Enum) Reset

func (x *Enum) Reset()

func (*Enum) String

func (x *Enum) String() string

type EnumValue

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

func (*EnumValue) Descriptor deprecated

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

Deprecated: Use EnumValue.ProtoReflect.Descriptor instead.

func (*EnumValue) GetName

func (x *EnumValue) GetName() string

func (*EnumValue) ProtoMessage

func (*EnumValue) ProtoMessage()

func (*EnumValue) ProtoReflect

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

func (*EnumValue) Reset

func (x *EnumValue) Reset()

func (*EnumValue) String

func (x *EnumValue) String() string

type EnvironmentVariable

type EnvironmentVariable struct {
	Name     string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Required bool   `protobuf:"varint,2,opt,name=required,proto3" json:"required,omitempty"`
	// contains filtered or unexported fields
}

func (*EnvironmentVariable) Descriptor deprecated

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

Deprecated: Use EnvironmentVariable.ProtoReflect.Descriptor instead.

func (*EnvironmentVariable) GetName

func (x *EnvironmentVariable) GetName() string

func (*EnvironmentVariable) GetRequired

func (x *EnvironmentVariable) GetRequired() bool

func (*EnvironmentVariable) ProtoMessage

func (*EnvironmentVariable) ProtoMessage()

func (*EnvironmentVariable) ProtoReflect

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

func (*EnvironmentVariable) Reset

func (x *EnvironmentVariable) Reset()

func (*EnvironmentVariable) String

func (x *EnvironmentVariable) String() string

type Event

type Event struct {

	// The name of this event, for example: account.created
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The name of the model.
	ModelName string `protobuf:"bytes,2,opt,name=model_name,json=modelName,proto3" json:"model_name,omitempty"`
	// Action type (create, update or delete).
	ActionType ActionType `protobuf:"varint,3,opt,name=action_type,json=actionType,proto3,enum=proto.ActionType" json:"action_type,omitempty"`
	// contains filtered or unexported fields
}

Events that can be triggered based on what has been defined in the schema. At the moment, we only support model-level events for create, update and delete mutations. This can be extended to support other kinds of events.

func FindEvent

func FindEvent(subscribers []*Event, name string) *Event

FindEvent locates the event of the given name.

func (*Event) Descriptor deprecated

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

Deprecated: Use Event.ProtoReflect.Descriptor instead.

func (*Event) GetActionType

func (x *Event) GetActionType() ActionType

func (*Event) GetModelName

func (x *Event) GetModelName() string

func (*Event) GetName

func (x *Event) GetName() string

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) ProtoReflect

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

func (*Event) Reset

func (x *Event) Reset()

func (*Event) String

func (x *Event) String() string

type Expression

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

func (*Expression) Descriptor deprecated

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

Deprecated: Use Expression.ProtoReflect.Descriptor instead.

func (*Expression) GetSource

func (x *Expression) GetSource() string

func (*Expression) ProtoMessage

func (*Expression) ProtoMessage()

func (*Expression) ProtoReflect

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

func (*Expression) Reset

func (x *Expression) Reset()

func (*Expression) String

func (x *Expression) String() string

type Field

type Field struct {

	// The name of the model this field belongs to.
	ModelName string `protobuf:"bytes,1,opt,name=model_name,json=modelName,proto3" json:"model_name,omitempty"`
	// The name of the field. Must be in lowerCamelCase and be unique within the model.
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// Info regarding the type of this field
	Type *TypeInfo `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
	// If true then this field is allowed to be null
	Optional bool `protobuf:"varint,4,opt,name=optional,proto3" json:"optional,omitempty"`
	// If true then this field will have a unique constraint added to it meaning
	// a given value can only exist in a single row.
	// Cannot be true if `type.repeated` is true
	Unique bool `protobuf:"varint,5,opt,name=unique,proto3" json:"unique,omitempty"`
	// If set then this field is part of a compount unique constraint with the
	// fields listed. The fields must be part of the same model and they must
	// list this field in their unique_with value.
	UniqueWith []string `protobuf:"bytes,8,rep,name=unique_with,json=uniqueWith,proto3" json:"unique_with,omitempty"`
	// If true then this field will be set as the primary key for the parent model
	PrimaryKey bool `protobuf:"varint,7,opt,name=primary_key,json=primaryKey,proto3" json:"primary_key,omitempty"`
	// If this field is of type TYPE_MODEL then this field indicates which field on _this_
	// model is the foriegn key. This field should always be populated on the many side of a
	// one-to-many relationship and on the unique side of a one-to-one.
	ForeignKeyFieldName *wrapperspb.StringValue `protobuf:"bytes,10,opt,name=foreign_key_field_name,json=foreignKeyFieldName,proto3" json:"foreign_key_field_name,omitempty"`
	// This describes how the default value of this field should be created
	DefaultValue *DefaultValue `protobuf:"bytes,9,opt,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"`
	// This only applies to the foreign key fields that we auto inject.
	// If it is non null it *defines* this field as being a foreign key field,
	// and carries corresponding metadata.
	ForeignKeyInfo *ForeignKeyInfo `protobuf:"bytes,11,opt,name=foreign_key_info,json=foreignKeyInfo,proto3" json:"foreign_key_info,omitempty"`
	// If this field is of type MODEL and the related model has an inverse field
	// to this one, then this field is set to that field name.
	// For example if a Post model has a field called author which is of type Author,
	// and then Author has posts which is of type Post, on the Post.author field this
	// value will be "posts" and on the Author.posts field this value will be "author".
	InverseFieldName *wrapperspb.StringValue `protobuf:"bytes,12,opt,name=inverse_field_name,json=inverseFieldName,proto3" json:"inverse_field_name,omitempty"`
	// contains filtered or unexported fields
}

func AllFields

func AllFields(p *Schema) []*Field

AllFields provides a list of all the model fields specified in the schema.

func FindField

func FindField(models []*Model, modelName string, fieldName string) *Field

func ForeignKeyFields

func ForeignKeyFields(model *Model) []*Field

ForeignKeyFields returns all the fields in the given model which have their ForeignKeyInfo populated.

func (*Field) Descriptor deprecated

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

Deprecated: Use Field.ProtoReflect.Descriptor instead.

func (*Field) GetDefaultValue

func (x *Field) GetDefaultValue() *DefaultValue

func (*Field) GetForeignKeyFieldName

func (x *Field) GetForeignKeyFieldName() *wrapperspb.StringValue

func (*Field) GetForeignKeyInfo

func (x *Field) GetForeignKeyInfo() *ForeignKeyInfo

func (*Field) GetInverseFieldName

func (x *Field) GetInverseFieldName() *wrapperspb.StringValue

func (*Field) GetModelName

func (x *Field) GetModelName() string

func (*Field) GetName

func (x *Field) GetName() string

func (*Field) GetOptional

func (x *Field) GetOptional() bool

func (*Field) GetPrimaryKey

func (x *Field) GetPrimaryKey() bool

func (*Field) GetType

func (x *Field) GetType() *TypeInfo

func (*Field) GetUnique

func (x *Field) GetUnique() bool

func (*Field) GetUniqueWith

func (x *Field) GetUniqueWith() []string

func (*Field) IsFile added in v0.388.0

func (f *Field) IsFile() bool

IsFile tells us if the field is a file

func (*Field) ProtoMessage

func (*Field) ProtoMessage()

func (*Field) ProtoReflect

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

func (*Field) Reset

func (x *Field) Reset()

func (*Field) String

func (x *Field) String() string

type ForeignKeyInfo

type ForeignKeyInfo struct {
	RelatedModelName  string `protobuf:"bytes,1,opt,name=related_model_name,json=relatedModelName,proto3" json:"related_model_name,omitempty"`
	RelatedModelField string `protobuf:"bytes,2,opt,name=related_model_field,json=relatedModelField,proto3" json:"related_model_field,omitempty"`
	// contains filtered or unexported fields
}

func (*ForeignKeyInfo) Descriptor deprecated

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

Deprecated: Use ForeignKeyInfo.ProtoReflect.Descriptor instead.

func (*ForeignKeyInfo) GetRelatedModelField

func (x *ForeignKeyInfo) GetRelatedModelField() string

func (*ForeignKeyInfo) GetRelatedModelName

func (x *ForeignKeyInfo) GetRelatedModelName() string

func (*ForeignKeyInfo) ProtoMessage

func (*ForeignKeyInfo) ProtoMessage()

func (*ForeignKeyInfo) ProtoReflect

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

func (*ForeignKeyInfo) Reset

func (x *ForeignKeyInfo) Reset()

func (*ForeignKeyInfo) String

func (x *ForeignKeyInfo) String() string

type Job

type Job struct {

	// The name of the job.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The inputs defined on the job.
	InputMessageName string `protobuf:"bytes,2,opt,name=input_message_name,json=inputMessageName,proto3" json:"input_message_name,omitempty"`
	// A permission rule which need to be satisfied in order to run the job.
	Permissions []*PermissionRule `protobuf:"bytes,3,rep,name=permissions,proto3" json:"permissions,omitempty"`
	// The schedule as an crontab expression.
	Schedule *Schedule `protobuf:"bytes,4,opt,name=schedule,proto3" json:"schedule,omitempty"`
	// contains filtered or unexported fields
}

func FindJob

func FindJob(jobs []*Job, name string) *Job

FindJob locates the job of the given name.

func (*Job) Descriptor deprecated

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

Deprecated: Use Job.ProtoReflect.Descriptor instead.

func (*Job) GetInputMessageName

func (x *Job) GetInputMessageName() string

func (*Job) GetName

func (x *Job) GetName() string

func (*Job) GetPermissions

func (x *Job) GetPermissions() []*PermissionRule

func (*Job) GetSchedule

func (x *Job) GetSchedule() *Schedule

func (*Job) ProtoMessage

func (*Job) ProtoMessage()

func (*Job) ProtoReflect

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

func (*Job) Reset

func (x *Job) Reset()

func (*Job) String

func (x *Job) String() string

type Message

type Message struct {

	// Name of the input or response message. Either generated from built-in
	// actions, hard-coded into the runtime (e.g. AuthenticateResponseMessage),
	// or specified in the schema using the message keyword.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The input or response fields for this message.
	Fields []*MessageField `protobuf:"bytes,2,rep,name=fields,proto3" json:"fields,omitempty"`
	// The message could be a Keel type and not an object.
	// Cannot be provided along with fields.
	Type *TypeInfo `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
	// contains filtered or unexported fields
}

func FindMessage

func FindMessage(messages []*Message, messageName string) *Message

FindMessage will find a message type defined in a Keel schema based on the name of the message e.g FindMessage("MyMessage") will return this node: message MyMessage {}

func FindValuesInputMessage

func FindValuesInputMessage(schema *Schema, actionName string) *Message

For built-in action types, returns the "values" input message, which may be nested inside the root message for some action types, or returns nil if not found.

func FindWhereInputMessage

func FindWhereInputMessage(schema *Schema, actionName string) *Message

For built-in action types, returns the "where" input message, which may be nested inside the root message for some action types, or returns nil if not found.

func (*Message) Descriptor deprecated

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

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetFields

func (x *Message) GetFields() []*MessageField

func (*Message) GetName

func (x *Message) GetName() string

func (*Message) GetType

func (x *Message) GetType() *TypeInfo

func (*Message) HasFiles added in v0.388.0

func (m *Message) HasFiles() bool

HasFiles checks if the message has any Inline file fields

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) ProtoReflect

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

func (*Message) Reset

func (x *Message) Reset()

func (*Message) String

func (x *Message) String() string

type MessageField

type MessageField struct {

	// Name of the parent message.
	MessageName string `protobuf:"bytes,1,opt,name=message_name,json=messageName,proto3" json:"message_name,omitempty"`
	// Name of the field.
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// The type of this field.
	Type *TypeInfo `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
	// Set to true if this can be omitted.
	Optional bool `protobuf:"varint,4,opt,name=optional,proto3" json:"optional,omitempty"`
	// Set to true if this can be set to the null value.
	Nullable bool `protobuf:"varint,6,opt,name=nullable,proto3" json:"nullable,omitempty"`
	// Only valid for implicit inputs on built-in actions (ACTION_IMPLEMENTATION_AUTO)
	// This field can be set to a path, from the current model, to a field that should
	// be read from or written to automatically by the runtime.
	// As an example if the parent model had a field called `item` which was a relationship to
	// an `Item` model which itself had a field called `price`, and this input wanted to filter
	// on the item price, then the value of `target` would be ["item", "price"].
	Target []string `protobuf:"bytes,5,rep,name=target,proto3" json:"target,omitempty"`
	// contains filtered or unexported fields
}

func FindMessageField

func FindMessageField(message *Message, fieldName string) *MessageField

func (*MessageField) Descriptor deprecated

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

Deprecated: Use MessageField.ProtoReflect.Descriptor instead.

func (*MessageField) GetMessageName

func (x *MessageField) GetMessageName() string

func (*MessageField) GetName

func (x *MessageField) GetName() string

func (*MessageField) GetNullable

func (x *MessageField) GetNullable() bool

func (*MessageField) GetOptional

func (x *MessageField) GetOptional() bool

func (*MessageField) GetTarget

func (x *MessageField) GetTarget() []string

func (*MessageField) GetType

func (x *MessageField) GetType() *TypeInfo

func (*MessageField) IsModelField

func (f *MessageField) IsModelField() bool

IsModelField returns true if the input targets a model field and is handled automatically by the runtime. This will only be true for inputs that are built-in actions, as functions never have this behaviour.

func (*MessageField) ProtoMessage

func (*MessageField) ProtoMessage()

func (*MessageField) ProtoReflect

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

func (*MessageField) Reset

func (x *MessageField) Reset()

func (*MessageField) String

func (x *MessageField) String() string

type Model

type Model struct {

	// The name of the model. Must be in PascalCase and be unique within the schema.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The fields this model contains
	Fields []*Field `protobuf:"bytes,2,rep,name=fields,proto3" json:"fields,omitempty"`
	// The actions this model defines. Contains both actions that will be auto
	// generated and also functions
	Actions     []*Action         `protobuf:"bytes,3,rep,name=actions,proto3" json:"actions,omitempty"`
	Permissions []*PermissionRule `protobuf:"bytes,4,rep,name=permissions,proto3" json:"permissions,omitempty"`
	// contains filtered or unexported fields
}

func ApiModels added in v0.376.0

func ApiModels(s *Schema, api *Api) []*Model

ApiModels provides the models defined in an API.

func FindModel

func FindModel(models []*Model, name string) *Model

FindModel locates the model of the given name.

func FindModels

func FindModels(allModels []*Model, namesToFind []string) (foundModels []*Model)

FindModels locates and returns the models whose names match up with those specified in the given names to find.

func (*Model) Descriptor deprecated

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

Deprecated: Use Model.ProtoReflect.Descriptor instead.

func (*Model) FileFields added in v0.388.0

func (m *Model) FileFields() []*Field

FileFields will return a slice of fields for the model that are of type file

func (*Model) GetActions

func (x *Model) GetActions() []*Action

func (*Model) GetFields

func (x *Model) GetFields() []*Field

func (*Model) GetName

func (x *Model) GetName() string

func (*Model) GetPermissions

func (x *Model) GetPermissions() []*PermissionRule

func (*Model) HasFiles added in v0.388.0

func (m *Model) HasFiles() bool

HasFiles checks if the model has any fields that are files

func (*Model) ProtoMessage

func (*Model) ProtoMessage()

func (*Model) ProtoReflect

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

func (*Model) Reset

func (x *Model) Reset()

func (*Model) String

func (x *Model) String() string

type OrderByStatement

type OrderByStatement struct {

	// The name of the field to perform ordering on.
	FieldName string `protobuf:"bytes,1,opt,name=field_name,json=fieldName,proto3" json:"field_name,omitempty"`
	// The direction in which to order.
	Direction OrderDirection `protobuf:"varint,2,opt,name=direction,proto3,enum=proto.OrderDirection" json:"direction,omitempty"`
	// contains filtered or unexported fields
}

func (*OrderByStatement) Descriptor deprecated

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

Deprecated: Use OrderByStatement.ProtoReflect.Descriptor instead.

func (*OrderByStatement) GetDirection

func (x *OrderByStatement) GetDirection() OrderDirection

func (*OrderByStatement) GetFieldName

func (x *OrderByStatement) GetFieldName() string

func (*OrderByStatement) ProtoMessage

func (*OrderByStatement) ProtoMessage()

func (*OrderByStatement) ProtoReflect

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

func (*OrderByStatement) Reset

func (x *OrderByStatement) Reset()

func (*OrderByStatement) String

func (x *OrderByStatement) String() string

type OrderDirection

type OrderDirection int32
const (
	OrderDirection_ORDER_DIRECTION_UNKNOWN   OrderDirection = 0
	OrderDirection_ORDER_DIRECTION_ASCENDING OrderDirection = 1
	OrderDirection_ORDER_DIRECTION_DECENDING OrderDirection = 2
)

func (OrderDirection) Descriptor

func (OrderDirection) Enum

func (x OrderDirection) Enum() *OrderDirection

func (OrderDirection) EnumDescriptor deprecated

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

Deprecated: Use OrderDirection.Descriptor instead.

func (OrderDirection) Number

func (OrderDirection) String

func (x OrderDirection) String() string

func (OrderDirection) Type

type PermissionFilter

type PermissionFilter = func(p *PermissionRule) bool

type PermissionRule

type PermissionRule struct {

	// Name of the model this permission rule applies to
	ModelName string `protobuf:"bytes,1,opt,name=model_name,json=modelName,proto3" json:"model_name,omitempty"`
	// Name of the specific action this permission rule applies to.
	// If this field is populated then `action_types` is ignored.
	ActionName *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=action_name,json=actionName,proto3" json:"action_name,omitempty"`
	// A name of a Role that has been defined in the schema.
	// Cannot be provided if `expression` is provided.
	RoleNames []string `protobuf:"bytes,3,rep,name=role_names,json=roleNames,proto3" json:"role_names,omitempty"`
	// An expression to evaluate at runtime.
	// Cannot be provided if `role_name` is provided.
	Expression *Expression `protobuf:"bytes,4,opt,name=expression,proto3" json:"expression,omitempty"`
	// A list of action types that this permission rule applies to
	// Should not be set if `action_name` is provided.
	ActionTypes []ActionType `protobuf:"varint,5,rep,packed,name=action_types,json=actionTypes,proto3,enum=proto.ActionType" json:"action_types,omitempty"`
	// contains filtered or unexported fields
}

func PermissionsForAction

func PermissionsForAction(schema *Schema, action *Action, filters ...PermissionFilter) (permissions []*PermissionRule)

func PermissionsForActionType

func PermissionsForActionType(schema *Schema, modelName string, actionType ActionType) []*PermissionRule

PermissionsForActionType returns a list of permissions defined for an action type on a model.

func PermissionsWithExpression

func PermissionsWithExpression(permissions []*PermissionRule) []*PermissionRule

PermissionsWithExpression returns a list of those permission present in the given permissions list, which have at least one expression-based permission rule. This does not imply that the returned Permissions might not also have some role-based rules.

func PermissionsWithRole

func PermissionsWithRole(permissions []*PermissionRule) []*PermissionRule

PermissionsWithRole returns a list of those permission present in the given permissions list, which have at least one Role-based permission rule. This does not imply that the returned Permissions might not also have some expression-based rules.

func (*PermissionRule) Descriptor deprecated

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

Deprecated: Use PermissionRule.ProtoReflect.Descriptor instead.

func (*PermissionRule) GetActionName

func (x *PermissionRule) GetActionName() *wrapperspb.StringValue

func (*PermissionRule) GetActionTypes

func (x *PermissionRule) GetActionTypes() []ActionType

func (*PermissionRule) GetExpression

func (x *PermissionRule) GetExpression() *Expression

func (*PermissionRule) GetModelName

func (x *PermissionRule) GetModelName() string

func (*PermissionRule) GetRoleNames

func (x *PermissionRule) GetRoleNames() []string

func (*PermissionRule) ProtoMessage

func (*PermissionRule) ProtoMessage()

func (*PermissionRule) ProtoReflect

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

func (*PermissionRule) Reset

func (x *PermissionRule) Reset()

func (*PermissionRule) String

func (x *PermissionRule) String() string

type Role

type Role struct {

	// The name of the role
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// A list of domains to match for this role e.g. myorg.com
	Domains []string `protobuf:"bytes,2,rep,name=domains,proto3" json:"domains,omitempty"`
	// A list of specific email addresses to match for this role eg. sarah@myorg.com
	Emails []string `protobuf:"bytes,3,rep,name=emails,proto3" json:"emails,omitempty"`
	// contains filtered or unexported fields
}

func FindRole

func FindRole(roleName string, schema *Schema) *Role

FindRole locates and returns the Role object that has the given name.

func (*Role) Descriptor deprecated

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

Deprecated: Use Role.ProtoReflect.Descriptor instead.

func (*Role) GetDomains

func (x *Role) GetDomains() []string

func (*Role) GetEmails

func (x *Role) GetEmails() []string

func (*Role) GetName

func (x *Role) GetName() string

func (*Role) ProtoMessage

func (*Role) ProtoMessage()

func (*Role) ProtoReflect

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

func (*Role) Reset

func (x *Role) Reset()

func (*Role) String

func (x *Role) String() string

type Schedule

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

func (*Schedule) Descriptor deprecated

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

Deprecated: Use Schedule.ProtoReflect.Descriptor instead.

func (*Schedule) GetExpression

func (x *Schedule) GetExpression() string

func (*Schedule) ProtoMessage

func (*Schedule) ProtoMessage()

func (*Schedule) ProtoReflect

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

func (*Schedule) Reset

func (x *Schedule) Reset()

func (*Schedule) String

func (x *Schedule) String() string

type Schema

type Schema struct {
	Models               []*Model               `protobuf:"bytes,1,rep,name=models,proto3" json:"models,omitempty"`
	Roles                []*Role                `protobuf:"bytes,2,rep,name=roles,proto3" json:"roles,omitempty"`
	Apis                 []*Api                 `protobuf:"bytes,3,rep,name=apis,proto3" json:"apis,omitempty"`
	Enums                []*Enum                `protobuf:"bytes,4,rep,name=enums,proto3" json:"enums,omitempty"`
	EnvironmentVariables []*EnvironmentVariable `protobuf:"bytes,5,rep,name=environment_variables,json=environmentVariables,proto3" json:"environment_variables,omitempty"`
	Messages             []*Message             `protobuf:"bytes,6,rep,name=messages,proto3" json:"messages,omitempty"`
	Secrets              []*Secret              `protobuf:"bytes,7,rep,name=secrets,proto3" json:"secrets,omitempty"`
	Jobs                 []*Job                 `protobuf:"bytes,8,rep,name=jobs,proto3" json:"jobs,omitempty"`
	Subscribers          []*Subscriber          `protobuf:"bytes,9,rep,name=subscribers,proto3" json:"subscribers,omitempty"`
	Events               []*Event               `protobuf:"bytes,10,rep,name=events,proto3" json:"events,omitempty"`
	// contains filtered or unexported fields
}

func (*Schema) Descriptor deprecated

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

Deprecated: Use Schema.ProtoReflect.Descriptor instead.

func (*Schema) GetApis

func (x *Schema) GetApis() []*Api

func (*Schema) GetEnums

func (x *Schema) GetEnums() []*Enum

func (*Schema) GetEnvironmentVariables

func (x *Schema) GetEnvironmentVariables() []*EnvironmentVariable

func (*Schema) GetEvents

func (x *Schema) GetEvents() []*Event

func (*Schema) GetJobs

func (x *Schema) GetJobs() []*Job

func (*Schema) GetMessages

func (x *Schema) GetMessages() []*Message

func (*Schema) GetModels

func (x *Schema) GetModels() []*Model

func (*Schema) GetRoles

func (x *Schema) GetRoles() []*Role

func (*Schema) GetSecrets

func (x *Schema) GetSecrets() []*Secret

func (*Schema) GetSubscribers

func (x *Schema) GetSubscribers() []*Subscriber

func (*Schema) HasFiles added in v0.388.0

func (p *Schema) HasFiles() bool

HasFiles checks if the given schema has any models with fields that are files

func (*Schema) ProtoMessage

func (*Schema) ProtoMessage()

func (*Schema) ProtoReflect

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

func (*Schema) Reset

func (x *Schema) Reset()

func (*Schema) String

func (x *Schema) String() string

type Secret

type Secret struct {
	Name     string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Required bool   `protobuf:"varint,2,opt,name=required,proto3" json:"required,omitempty"`
	// contains filtered or unexported fields
}

func (*Secret) Descriptor deprecated

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

Deprecated: Use Secret.ProtoReflect.Descriptor instead.

func (*Secret) GetName

func (x *Secret) GetName() string

func (*Secret) GetRequired

func (x *Secret) GetRequired() bool

func (*Secret) ProtoMessage

func (*Secret) ProtoMessage()

func (*Secret) ProtoReflect

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

func (*Secret) Reset

func (x *Secret) Reset()

func (*Secret) String

func (x *Secret) String() string

type Subscriber

type Subscriber struct {

	// The name of the subscriber function. e.g. sendWelcomeMail.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The input message for this function.
	// The structure of this is determined by the events handled by this subscriber.
	InputMessageName string `protobuf:"bytes,2,opt,name=input_message_name,json=inputMessageName,proto3" json:"input_message_name,omitempty"`
	// The events which are handled by this subscriber.
	EventNames []string `protobuf:"bytes,3,rep,name=event_names,json=eventNames,proto3" json:"event_names,omitempty"`
	// contains filtered or unexported fields
}

func FindEventSubscriptions added in v0.368.0

func FindEventSubscriptions(schema *Schema, event *Event) []*Subscriber

FindSubscriber locates the subscriber of the given name.

func FindSubscriber

func FindSubscriber(subscribers []*Subscriber, name string) *Subscriber

FindSubscriber locates the subscriber of the given name.

func (*Subscriber) Descriptor deprecated

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

Deprecated: Use Subscriber.ProtoReflect.Descriptor instead.

func (*Subscriber) GetEventNames

func (x *Subscriber) GetEventNames() []string

func (*Subscriber) GetInputMessageName

func (x *Subscriber) GetInputMessageName() string

func (*Subscriber) GetName

func (x *Subscriber) GetName() string

func (*Subscriber) ProtoMessage

func (*Subscriber) ProtoMessage()

func (*Subscriber) ProtoReflect

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

func (*Subscriber) Reset

func (x *Subscriber) Reset()

func (*Subscriber) String

func (x *Subscriber) String() string

type Type

type Type int32
const (
	Type_TYPE_UNKNOWN   Type = 0
	Type_TYPE_STRING    Type = 1
	Type_TYPE_BOOL      Type = 2
	Type_TYPE_INT       Type = 3
	Type_TYPE_TIMESTAMP Type = 4
	Type_TYPE_DATE      Type = 5
	Type_TYPE_ID        Type = 6
	Type_TYPE_MODEL     Type = 7
	Type_TYPE_CURRENCY  Type = 8
	Type_TYPE_DATETIME  Type = 9
	Type_TYPE_ENUM      Type = 10
	Type_TYPE_IMAGE     Type = 12
	Type_TYPE_OBJECT    Type = 13
	// Used for sensitive data. Encrypted at rest, decrypted on read.
	Type_TYPE_SECRET Type = 14
	// Used for hashing passwords and passcodes with the intention to verify admission.
	Type_TYPE_PASSWORD Type = 15
	Type_TYPE_MESSAGE  Type = 16
	// Any is used in Message types to denote a field with any type.
	Type_TYPE_ANY Type = 17
	// Used to specify a sort direction argument.
	Type_TYPE_SORT_DIRECTION Type = 18
	// A union type describes a value that can be one of several types.
	// These types are listed in TypeInfo's Union_Names property.
	Type_TYPE_UNION Type = 19
	// A string literal type which can be used to discriminate on in our Typescript types.
	// TYPE_INFO string_literal_type must also be set.
	Type_TYPE_STRING_LITERAL Type = 20
	// Markdown rich text field.
	Type_TYPE_MARKDOWN Type = 21
	// Decimal number type; fixed precision.
	Type_TYPE_DECIMAL Type = 22
	// A vector type.
	Type_TYPE_VECTOR Type = 23
	// A file, supplied inline, as a data-url
	Type_TYPE_INLINE_FILE Type = 24
)

func (Type) Descriptor

func (Type) Descriptor() protoreflect.EnumDescriptor

func (Type) Enum

func (x Type) Enum() *Type

func (Type) EnumDescriptor deprecated

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

Deprecated: Use Type.Descriptor instead.

func (Type) Number

func (x Type) Number() protoreflect.EnumNumber

func (Type) String

func (x Type) String() string

func (Type) Type

func (Type) Type() protoreflect.EnumType

type TypeInfo

type TypeInfo struct {

	// The type of the field.
	Type Type `protobuf:"varint,1,opt,name=type,proto3,enum=proto.Type" json:"type,omitempty"`
	// If `type` is set to TYPE_ENUM then this value is the name of the
	// the enum that the type refers to.
	EnumName *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=enum_name,json=enumName,proto3" json:"enum_name,omitempty"`
	// If this field is set then this type is referring to another model.
	// In the case of TYPE_MODEL this type _is_ the model named here.
	// In the case of other types e.g. TYPE_ID this type is referencing a field
	// on the model named here, and the specific field being referenced is indicated
	// by `field_name`.
	ModelName *wrapperspb.StringValue `protobuf:"bytes,3,opt,name=model_name,json=modelName,proto3" json:"model_name,omitempty"`
	// This field indicates which field on `model_name` this type is referencing.
	// This field should only be set if `model_name` is set.
	FieldName *wrapperspb.StringValue `protobuf:"bytes,5,opt,name=field_name,json=fieldName,proto3" json:"field_name,omitempty"`
	// Only valid within a Message
	MessageName *wrapperspb.StringValue `protobuf:"bytes,6,opt,name=message_name,json=messageName,proto3" json:"message_name,omitempty"`
	// If true then is type is an array of it's `type`
	Repeated bool `protobuf:"varint,4,opt,name=repeated,proto3" json:"repeated,omitempty"`
	// A union type describes a value that can be one of several types.
	// When TypeInfo's type property is set to UNION, then any one of the type names
	// listed here can be used as input. Currently only support messages.
	UnionNames []*wrapperspb.StringValue `protobuf:"bytes,7,rep,name=union_names,json=unionNames,proto3" json:"union_names,omitempty"`
	// For types which are in a union, it is optional to provide a value to discriminate on.
	// This is only useful in TypeScript type generation, where this will make type a string literal type.
	StringLiteralValue *wrapperspb.StringValue `protobuf:"bytes,8,opt,name=string_literal_value,json=stringLiteralValue,proto3" json:"string_literal_value,omitempty"`
	// contains filtered or unexported fields
}

func (*TypeInfo) Descriptor deprecated

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

Deprecated: Use TypeInfo.ProtoReflect.Descriptor instead.

func (*TypeInfo) GetEnumName

func (x *TypeInfo) GetEnumName() *wrapperspb.StringValue

func (*TypeInfo) GetFieldName

func (x *TypeInfo) GetFieldName() *wrapperspb.StringValue

func (*TypeInfo) GetMessageName

func (x *TypeInfo) GetMessageName() *wrapperspb.StringValue

func (*TypeInfo) GetModelName

func (x *TypeInfo) GetModelName() *wrapperspb.StringValue

func (*TypeInfo) GetRepeated

func (x *TypeInfo) GetRepeated() bool

func (*TypeInfo) GetStringLiteralValue added in v0.368.0

func (x *TypeInfo) GetStringLiteralValue() *wrapperspb.StringValue

func (*TypeInfo) GetType

func (x *TypeInfo) GetType() Type

func (*TypeInfo) GetUnionNames

func (x *TypeInfo) GetUnionNames() []*wrapperspb.StringValue

func (*TypeInfo) ProtoMessage

func (*TypeInfo) ProtoMessage()

func (*TypeInfo) ProtoReflect

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

func (*TypeInfo) Reset

func (x *TypeInfo) Reset()

func (*TypeInfo) String

func (x *TypeInfo) String() string

Jump to

Keyboard shortcuts

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