forgepb

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StoreAs_name = map[int32]string{
		0: "STORE_AS_UNSPECIFIED",
		1: "STORE_AS_JSONB",
		2: "STORE_AS_TEXT",
		3: "STORE_AS_BLOB",
		4: "STORE_AS_TABLE",
	}
	StoreAs_value = map[string]int32{
		"STORE_AS_UNSPECIFIED": 0,
		"STORE_AS_JSONB":       1,
		"STORE_AS_TEXT":        2,
		"STORE_AS_BLOB":        3,
		"STORE_AS_TABLE":       4,
	}
)

Enum value maps for StoreAs.

View Source
var (
	ServiceVisibility_name = map[int32]string{
		0: "SERVICE_VISIBILITY_UNSPECIFIED",
		1: "SERVICE_VISIBILITY_API",
		2: "SERVICE_VISIBILITY_INTERNAL",
	}
	ServiceVisibility_value = map[string]int32{
		"SERVICE_VISIBILITY_UNSPECIFIED": 0,
		"SERVICE_VISIBILITY_API":         1,
		"SERVICE_VISIBILITY_INTERNAL":    2,
	}
)

Enum value maps for ServiceVisibility.

View Source
var (
	ConfigFieldRole_name = map[int32]string{
		0: "CONFIG_FIELD_ROLE_UNSPECIFIED",
		1: "CONFIG_FIELD_ROLE_MODE",
		2: "CONFIG_FIELD_ROLE_TLS_CERT",
		3: "CONFIG_FIELD_ROLE_TLS_KEY",
		4: "CONFIG_FIELD_ROLE_CORS_ORIGINS",
		5: "CONFIG_FIELD_ROLE_CORS_ALLOW_CREDENTIALS",
	}
	ConfigFieldRole_value = map[string]int32{
		"CONFIG_FIELD_ROLE_UNSPECIFIED":            0,
		"CONFIG_FIELD_ROLE_MODE":                   1,
		"CONFIG_FIELD_ROLE_TLS_CERT":               2,
		"CONFIG_FIELD_ROLE_TLS_KEY":                3,
		"CONFIG_FIELD_ROLE_CORS_ORIGINS":           4,
		"CONFIG_FIELD_ROLE_CORS_ALLOW_CREDENTIALS": 5,
	}
)

Enum value maps for ConfigFieldRole.

View Source
var (
	// Database column mapping and constraints.
	//
	// Retired: ignored by forge. SQL is the schema — db/migrations drive entity
	// projections. Kept only so legacy protos keep compiling.
	//
	// optional forge.v1.FieldOptions field = 50300;
	E_Field = &file_forge_v1_forge_proto_extTypes[1]
	// Configuration binding to environment variables and CLI flags.
	//
	// optional forge.v1.ConfigFieldOptions config = 50400;
	E_Config = &file_forge_v1_forge_proto_extTypes[2]
)

Extension fields to descriptorpb.FieldOptions.

View Source
var (
	// optional forge.v1.EntityOptions entity = 50200;
	E_Entity = &file_forge_v1_forge_proto_extTypes[0]
)

Extension fields to descriptorpb.MessageOptions.

View Source
var (
	// optional forge.v1.MethodOptions method = 50100;
	E_Method = &file_forge_v1_forge_proto_extTypes[4]
)

Extension fields to descriptorpb.MethodOptions.

View Source
var (
	// optional forge.v1.ServiceOptions service = 50000;
	E_Service = &file_forge_v1_forge_proto_extTypes[3]
)

Extension fields to descriptorpb.ServiceOptions.

View Source
var File_forge_v1_forge_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {

	// Whether authentication is required for this service by default.
	AuthRequired bool `protobuf:"varint,1,opt,name=auth_required,json=authRequired,proto3" json:"auth_required,omitempty"`
	// Authentication provider identifier (e.g., "jwt", "api_key", "oauth2").
	AuthProvider string `protobuf:"bytes,2,opt,name=auth_provider,json=authProvider,proto3" json:"auth_provider,omitempty"`
	// contains filtered or unexported fields
}

AuthConfig defines service-wide authentication defaults. Individual methods can override via MethodOptions.auth_required.

func (*AuthConfig) Descriptor deprecated

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

Deprecated: Use AuthConfig.ProtoReflect.Descriptor instead.

func (*AuthConfig) GetAuthProvider

func (x *AuthConfig) GetAuthProvider() string

func (*AuthConfig) GetAuthRequired

func (x *AuthConfig) GetAuthRequired() bool

func (*AuthConfig) ProtoMessage

func (*AuthConfig) ProtoMessage()

func (*AuthConfig) ProtoReflect

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

func (*AuthConfig) Reset

func (x *AuthConfig) Reset()

func (*AuthConfig) String

func (x *AuthConfig) String() string

type ConfigFieldOptions

type ConfigFieldOptions struct {

	// Environment variable name to read this field from (e.g., "DATABASE_URL").
	EnvVar string `protobuf:"bytes,1,opt,name=env_var,json=envVar,proto3" json:"env_var,omitempty"`
	// CLI flag name, without leading dashes (e.g., "database-url").
	Flag string `protobuf:"bytes,2,opt,name=flag,proto3" json:"flag,omitempty"`
	// Default value as a string. Applied when neither env var nor flag is set.
	DefaultValue string `protobuf:"bytes,3,opt,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"`
	// Whether this field must be provided. Startup fails if missing.
	Required bool `protobuf:"varint,4,opt,name=required,proto3" json:"required,omitempty"`
	// Human-readable description shown in --help output and documentation.
	Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
	// Sensitive marks this field as secret — its value MUST come from a
	// Kubernetes Secret (or equivalent) rather than a literal env-var, and
	// it is never written to forge.yaml inline. The deploy generator emits
	// a `secretKeyRef`-shaped EnvVar referencing a project-level Secret
	// (default name: <project>-secrets, key: <env_var>).
	Sensitive bool `protobuf:"varint,6,opt,name=sensitive,proto3" json:"sensitive,omitempty"`
	// Category groups related fields for KCL emission. Fields with the same
	// category are rendered together as a single env-var group (e.g.
	// category: "stripe" → STRIPE_ENV bundle). Empty category lands the
	// field in the default APP_ENV bundle.
	Category string `protobuf:"bytes,7,opt,name=category,proto3" json:"category,omitempty"`
	// Role tags a field with a SEMANTIC meaning that drives behavior, so
	// forge/pkg/config can offer annotation-driven helpers without matching
	// on the field's NAME. Renaming a field never changes behavior — the
	// behavior follows the annotation. Naming a field "environment" without
	// the annotation does NOT make it the mode field.
	Role ConfigFieldRole `protobuf:"varint,8,opt,name=role,proto3,enum=forge.v1.ConfigFieldRole" json:"role,omitempty"`
	// AllowedValues constrains a STRING field to a closed set of valid
	// values, validated at startup by config.Validate. It is the
	// type/annotation-driven replacement for the old name-matched log-format
	// check ("json"/"text"): a string field carrying allowed_values is a
	// string ENUM, rejected when its resolved value is outside the set. The
	// empty value is always permitted (an unset, non-required field). True
	// proto enum fields don't need this — protoreflect already enforces their
	// domain. Renaming the field changes nothing; the set follows the
	// annotation.
	AllowedValues []string `protobuf:"bytes,9,rep,name=allowed_values,json=allowedValues,proto3" json:"allowed_values,omitempty"`
	// contains filtered or unexported fields
}

ConfigFieldOptions defines how a config protobuf field maps to runtime configuration sources (environment variables and CLI flags).

Example usage:

message MyServiceConfig {
  string database_url = 1 [(forge.v1.config) = {
    env_var: "DATABASE_URL",
    flag: "database-url",
    required: true,
    description: "PostgreSQL connection string"
  }];
}

func (*ConfigFieldOptions) Descriptor deprecated

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

Deprecated: Use ConfigFieldOptions.ProtoReflect.Descriptor instead.

func (*ConfigFieldOptions) GetAllowedValues

func (x *ConfigFieldOptions) GetAllowedValues() []string

func (*ConfigFieldOptions) GetCategory

func (x *ConfigFieldOptions) GetCategory() string

func (*ConfigFieldOptions) GetDefaultValue

func (x *ConfigFieldOptions) GetDefaultValue() string

func (*ConfigFieldOptions) GetDescription

func (x *ConfigFieldOptions) GetDescription() string

func (*ConfigFieldOptions) GetEnvVar

func (x *ConfigFieldOptions) GetEnvVar() string

func (*ConfigFieldOptions) GetFlag

func (x *ConfigFieldOptions) GetFlag() string

func (*ConfigFieldOptions) GetRequired

func (x *ConfigFieldOptions) GetRequired() bool

func (*ConfigFieldOptions) GetRole

func (x *ConfigFieldOptions) GetRole() ConfigFieldRole

func (*ConfigFieldOptions) GetSensitive

func (x *ConfigFieldOptions) GetSensitive() bool

func (*ConfigFieldOptions) ProtoMessage

func (*ConfigFieldOptions) ProtoMessage()

func (*ConfigFieldOptions) ProtoReflect

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

func (*ConfigFieldOptions) Reset

func (x *ConfigFieldOptions) Reset()

func (*ConfigFieldOptions) String

func (x *ConfigFieldOptions) String() string

type ConfigFieldRole

type ConfigFieldRole int32

ConfigFieldRole enumerates the semantic roles a config field can carry. Today the only role is MODE (the runtime production/development switch that gates dev ergonomics and the explicit auth bypass). Additional roles can be added here as new annotation-driven semantics appear.

const (
	// CONFIG_FIELD_ROLE_UNSPECIFIED is the default: an ordinary config
	// field with no special semantics.
	ConfigFieldRole_CONFIG_FIELD_ROLE_UNSPECIFIED ConfigFieldRole = 0
	// CONFIG_FIELD_ROLE_MODE marks the field whose string value selects the
	// runtime mode: "development"/"dev" → development, anything else →
	// production. config.Mode(msg) and config.DevAuthBypass(msg) key off
	// THIS field, regardless of its name.
	ConfigFieldRole_CONFIG_FIELD_ROLE_MODE ConfigFieldRole = 1
	// CONFIG_FIELD_ROLE_TLS_CERT and CONFIG_FIELD_ROLE_TLS_KEY mark the two
	// halves of a TLS keypair. config.Validate enforces both-or-neither:
	// setting exactly one is a configuration error (the server would silently
	// fall back to plaintext). Selected by annotation, not by the names
	// "tls_cert_path"/"tls_key_path".
	ConfigFieldRole_CONFIG_FIELD_ROLE_TLS_CERT ConfigFieldRole = 2
	ConfigFieldRole_CONFIG_FIELD_ROLE_TLS_KEY  ConfigFieldRole = 3
	// CONFIG_FIELD_ROLE_CORS_ORIGINS marks the comma-separated CORS allow-list
	// and CONFIG_FIELD_ROLE_CORS_ALLOW_CREDENTIALS marks the credentials bool.
	// config.Validate rejects the spec-invalid combination of a wildcard
	// origin ("*") with credentials=true. Selected by annotation, not by the
	// field names.
	ConfigFieldRole_CONFIG_FIELD_ROLE_CORS_ORIGINS           ConfigFieldRole = 4
	ConfigFieldRole_CONFIG_FIELD_ROLE_CORS_ALLOW_CREDENTIALS ConfigFieldRole = 5
)

func (ConfigFieldRole) Descriptor

func (ConfigFieldRole) Enum

func (x ConfigFieldRole) Enum() *ConfigFieldRole

func (ConfigFieldRole) EnumDescriptor deprecated

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

Deprecated: Use ConfigFieldRole.Descriptor instead.

func (ConfigFieldRole) Number

func (ConfigFieldRole) String

func (x ConfigFieldRole) String() string

func (ConfigFieldRole) Type

type EntityOptions

type EntityOptions struct {

	// Database table name. Inferred from the message name (snake_case, pluralized)
	// when left empty.
	Table string `protobuf:"bytes,1,opt,name=table,proto3" json:"table,omitempty"`
	// Enable soft-delete semantics (adds a deleted_at column).
	SoftDelete bool `protobuf:"varint,2,opt,name=soft_delete,json=softDelete,proto3" json:"soft_delete,omitempty"`
	// Automatically manage created_at and updated_at timestamp columns.
	Timestamps bool `protobuf:"varint,3,opt,name=timestamps,proto3" json:"timestamps,omitempty"`
	// Composite or single-column indexes to create on this table.
	Indexes []*IndexDef `protobuf:"bytes,4,rep,name=indexes,proto3" json:"indexes,omitempty"`
	// Contract middleware to wire around generated repository methods.
	// Supported values: "tracing", "metrics", "logging".
	Middleware []string `protobuf:"bytes,5,rep,name=middleware,proto3" json:"middleware,omitempty"`
	// contains filtered or unexported fields
}

EntityOptions defines how a protobuf message maps to a database table.

DEPRECATED — Retired: ignored by forge. SQL is the schema — db/migrations drive entity projections. Kept for one release so legacy projects' protos keep compiling; remove the annotations from your protos.

func (*EntityOptions) Descriptor deprecated

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

Deprecated: Use EntityOptions.ProtoReflect.Descriptor instead.

func (*EntityOptions) GetIndexes

func (x *EntityOptions) GetIndexes() []*IndexDef

func (*EntityOptions) GetMiddleware

func (x *EntityOptions) GetMiddleware() []string

func (*EntityOptions) GetSoftDelete

func (x *EntityOptions) GetSoftDelete() bool

func (*EntityOptions) GetTable

func (x *EntityOptions) GetTable() string

func (*EntityOptions) GetTimestamps

func (x *EntityOptions) GetTimestamps() bool

func (*EntityOptions) ProtoMessage

func (*EntityOptions) ProtoMessage()

func (*EntityOptions) ProtoReflect

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

func (*EntityOptions) Reset

func (x *EntityOptions) Reset()

func (*EntityOptions) String

func (x *EntityOptions) String() string

type FieldOptions

type FieldOptions struct {

	// Mark this field as the primary key.
	Pk bool `protobuf:"varint,1,opt,name=pk,proto3" json:"pk,omitempty"`
	// Mark this field as the tenant key for row-level isolation in
	// multi-tenant schemas.
	Tenant bool `protobuf:"varint,2,opt,name=tenant,proto3" json:"tenant,omitempty"`
	// How to store complex or non-scalar types in the database.
	Store StoreAs `protobuf:"varint,3,opt,name=store,proto3,enum=forge.v1.StoreAs" json:"store,omitempty"`
	// Foreign key reference in "table.column" format (e.g., "users.id").
	Ref string `protobuf:"bytes,4,opt,name=ref,proto3" json:"ref,omitempty"`
	// Column has a UNIQUE constraint.
	Unique bool `protobuf:"varint,5,opt,name=unique,proto3" json:"unique,omitempty"`
	// Create a single-column index on this field.
	Index bool `protobuf:"varint,6,opt,name=index,proto3" json:"index,omitempty"`
	// SQL default expression (e.g., "0", "'active'", "NOW()").
	DefaultValue string `protobuf:"bytes,7,opt,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"`
	// Skip this field in code generation entirely.
	Skip bool `protobuf:"varint,8,opt,name=skip,proto3" json:"skip,omitempty"`
	// Application-layer validation rules for this field.
	Validate *ValidationRules `protobuf:"bytes,9,opt,name=validate,proto3" json:"validate,omitempty"`
	// Field cannot be updated after initial creation.
	Immutable bool `protobuf:"varint,10,opt,name=immutable,proto3" json:"immutable,omitempty"`
	// contains filtered or unexported fields
}

FieldOptions defines how a protobuf field maps to a database column.

DEPRECATED — Retired: ignored by forge. SQL is the schema — db/migrations drive entity projections. Kept for one release so legacy projects' protos keep compiling; remove the annotations from your protos.

func (*FieldOptions) Descriptor deprecated

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

Deprecated: Use FieldOptions.ProtoReflect.Descriptor instead.

func (*FieldOptions) GetDefaultValue

func (x *FieldOptions) GetDefaultValue() string

func (*FieldOptions) GetImmutable

func (x *FieldOptions) GetImmutable() bool

func (*FieldOptions) GetIndex

func (x *FieldOptions) GetIndex() bool

func (*FieldOptions) GetPk

func (x *FieldOptions) GetPk() bool

func (*FieldOptions) GetRef

func (x *FieldOptions) GetRef() string

func (*FieldOptions) GetSkip

func (x *FieldOptions) GetSkip() bool

func (*FieldOptions) GetStore

func (x *FieldOptions) GetStore() StoreAs

func (*FieldOptions) GetTenant

func (x *FieldOptions) GetTenant() bool

func (*FieldOptions) GetUnique

func (x *FieldOptions) GetUnique() bool

func (*FieldOptions) GetValidate

func (x *FieldOptions) GetValidate() *ValidationRules

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 IndexDef

type IndexDef struct {

	// Index name. Auto-generated from field names when left empty.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Column names included in this index, in order.
	Fields []string `protobuf:"bytes,2,rep,name=fields,proto3" json:"fields,omitempty"`
	// Whether this index enforces a uniqueness constraint.
	Unique bool `protobuf:"varint,3,opt,name=unique,proto3" json:"unique,omitempty"`
	// contains filtered or unexported fields
}

IndexDef defines a database index on one or more columns.

DEPRECATED — Retired: ignored by forge. SQL is the schema — db/migrations drive entity projections. Declare indexes in migration SQL instead.

func (*IndexDef) Descriptor deprecated

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

Deprecated: Use IndexDef.ProtoReflect.Descriptor instead.

func (*IndexDef) GetFields

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

func (*IndexDef) GetName

func (x *IndexDef) GetName() string

func (*IndexDef) GetUnique

func (x *IndexDef) GetUnique() bool

func (*IndexDef) ProtoMessage

func (*IndexDef) ProtoMessage()

func (*IndexDef) ProtoReflect

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

func (*IndexDef) Reset

func (x *IndexDef) Reset()

func (*IndexDef) String

func (x *IndexDef) String() string

type MethodOptions

type MethodOptions struct {

	// Whether this method requires authentication. Optional so the default
	// (fail-closed: auth required) is distinguishable from an explicit
	// `auth_required = false` opt-out at the proto level.
	// Overrides the service-level AuthConfig.auth_required default.
	AuthRequired *bool `protobuf:"varint,1,opt,name=auth_required,json=authRequired,proto3,oneof" json:"auth_required,omitempty"`
	// Whether this method is idempotent (safe to retry without side effects).
	Idempotent bool `protobuf:"varint,3,opt,name=idempotent,proto3" json:"idempotent,omitempty"`
	// Server-side timeout for this method. Zero means use the service default.
	Timeout *durationpb.Duration `protobuf:"bytes,4,opt,name=timeout,proto3" json:"timeout,omitempty"`
	// Whether callers should supply an idempotency key for this method.
	// This is a convention marker — Forge does not enforce or inspect the key.
	// When set, tooling, docs, and generated clients advise callers to pass a
	// unique key (e.g., an Idempotency-Key header) so the server can safely
	// deduplicate retried mutations.
	IdempotencyKey bool `protobuf:"varint,5,opt,name=idempotency_key,json=idempotencyKey,proto3" json:"idempotency_key,omitempty"`
	// Declared Connect/gRPC error codes this method can return. Codegen
	// surfaces these so handler authors (and LLMs implementing handlers)
	// can see the typed error contract at a glance. Values match
	// connect.Code names — e.g. "NotFound", "PermissionDenied",
	// "InvalidArgument". Empty (or unset) means "no declared errors" — the
	// method either succeeds or returns an undeclared Connect.Code.
	//
	// The list is informational at runtime today; future work may enforce
	// that handlers can only return declared codes.
	Errors []string `protobuf:"bytes,6,rep,name=errors,proto3" json:"errors,omitempty"`
	// Per-method authorization role allow-list. The caller must hold AT LEAST
	// ONE of these roles for the call to be authorized (any-of semantics).
	// Role implication is applied by pkg/authz at decision time (e.g. "admin"
	// implies "user" when an implication map is configured), so listing only
	// the least-privileged sufficient role is the idiom.
	//
	// Presence is what the authz completeness lint checks: a method that sets
	// required_roles (even to a single role) is "explicitly authorized". A
	// method that wants any-authenticated access with NO role restriction must
	// say so explicitly via the `authz_public` marker below — an empty
	// required_roles is treated as "unannotated" and fails the lint, so a
	// method can never silently default to open. When absent, the service's
	// (forge.v1.service).default_roles applies; if neither is set the lint
	// fails the build naming the method.
	RequiredRoles []string `protobuf:"bytes,7,rep,name=required_roles,json=requiredRoles,proto3" json:"required_roles,omitempty"`
	// Marks a method as intentionally reachable by ANY caller the auth layer
	// admits, with no role restriction (e.g. a health check or a public read).
	// This is the explicit, greppable opt-out that satisfies the authz
	// completeness lint without granting it by accident: a method is "open"
	// only when an author typed `authz_public = true`, never by omission.
	// Mutually exclusive with required_roles (setting both fails the lint).
	AuthzPublic bool `protobuf:"varint,8,opt,name=authz_public,json=authzPublic,proto3" json:"authz_public,omitempty"`
	// Marks a method whose authorization is performed by a HAND-WRITTEN
	// per-service authorizer (middleware.Authorizer), not by the shared
	// descriptor RoleInterceptor. Use this ONLY when the decision is genuinely
	// not expressible as a role allow-list — e.g. it gates on a specific
	// subject/identity, a per-request resource scope, or an out-of-band
	// (client-only / reverse-proxied) RPC the local server never serves.
	//
	// It is the explicit, greppable escape that satisfies the authz
	// completeness lint for such methods: the build accepts the method as
	// "intentionally custom-authorized" instead of forcing a role annotation
	// that would mis-state the real policy. It grants NOTHING — pkg/authz's
	// descriptor policy builder still leaves the method OUT of the shared
	// RolePolicy, so if such a method is ever routed through the shared
	// RoleInterceptor it fail-closes (denied). The service must keep its own
	// authorizer (and, when served, route through it) — this marker only
	// records that the proto deliberately delegates the decision to code.
	//
	// Mutually exclusive with required_roles and authz_public (setting more
	// than one fails the lint).
	AuthzCustom bool `protobuf:"varint,9,opt,name=authz_custom,json=authzCustom,proto3" json:"authz_custom,omitempty"`
	// contains filtered or unexported fields
}

MethodOptions defines per-method behavior annotations for Connect RPC methods. Apply via [(forge.v1.method) = { ... }] on any rpc definition.

func (*MethodOptions) Descriptor deprecated

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

Deprecated: Use MethodOptions.ProtoReflect.Descriptor instead.

func (*MethodOptions) GetAuthRequired

func (x *MethodOptions) GetAuthRequired() bool

func (*MethodOptions) GetAuthzCustom

func (x *MethodOptions) GetAuthzCustom() bool

func (*MethodOptions) GetAuthzPublic

func (x *MethodOptions) GetAuthzPublic() bool

func (*MethodOptions) GetErrors

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

func (*MethodOptions) GetIdempotencyKey

func (x *MethodOptions) GetIdempotencyKey() bool

func (*MethodOptions) GetIdempotent

func (x *MethodOptions) GetIdempotent() bool

func (*MethodOptions) GetRequiredRoles

func (x *MethodOptions) GetRequiredRoles() []string

func (*MethodOptions) GetTimeout

func (x *MethodOptions) GetTimeout() *durationpb.Duration

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 ServiceOptions

type ServiceOptions struct {

	// Human-readable service name used in code generation and logging.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// API version string (e.g., "v1", "v2beta1").
	Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
	// Brief description of the service's purpose.
	Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	// Controls how the service is exposed.
	Visibility ServiceVisibility `protobuf:"varint,4,opt,name=visibility,proto3,enum=forge.v1.ServiceVisibility" json:"visibility,omitempty"`
	// Other services this service depends on (for dependency injection).
	Dependencies []string `protobuf:"bytes,5,rep,name=dependencies,proto3" json:"dependencies,omitempty"`
	// Authentication configuration for the service.
	Auth *AuthConfig `protobuf:"bytes,6,opt,name=auth,proto3" json:"auth,omitempty"`
	// Service-wide default authorization roles. A method that declares no
	// (forge.v1.method).required_roles inherits this list: the caller must
	// hold at least one of these roles. An empty list here means "no service
	// default" — every method must then declare its own required_roles (the
	// authz completeness lint enforces exactly this, so a method can never
	// silently default to open). See pkg/authz and the `auth` skill.
	DefaultRoles []string `protobuf:"bytes,7,rep,name=default_roles,json=defaultRoles,proto3" json:"default_roles,omitempty"`
	// contains filtered or unexported fields
}

ServiceOptions defines metadata and behavior for a Connect RPC service. Apply via [(forge.v1.service) = { ... }] on any service definition.

func (*ServiceOptions) Descriptor deprecated

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

Deprecated: Use ServiceOptions.ProtoReflect.Descriptor instead.

func (*ServiceOptions) GetAuth

func (x *ServiceOptions) GetAuth() *AuthConfig

func (*ServiceOptions) GetDefaultRoles

func (x *ServiceOptions) GetDefaultRoles() []string

func (*ServiceOptions) GetDependencies

func (x *ServiceOptions) GetDependencies() []string

func (*ServiceOptions) GetDescription

func (x *ServiceOptions) GetDescription() string

func (*ServiceOptions) GetName

func (x *ServiceOptions) GetName() string

func (*ServiceOptions) GetVersion

func (x *ServiceOptions) GetVersion() string

func (*ServiceOptions) GetVisibility

func (x *ServiceOptions) GetVisibility() ServiceVisibility

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 ServiceVisibility

type ServiceVisibility int32

ServiceVisibility determines how a service is exposed.

const (
	// Unspecified; defaults to API visibility.
	ServiceVisibility_SERVICE_VISIBILITY_UNSPECIFIED ServiceVisibility = 0
	// Exposed via HTTP/Connect gateway.
	ServiceVisibility_SERVICE_VISIBILITY_API ServiceVisibility = 1
	// Only accessible for inter-service communication.
	ServiceVisibility_SERVICE_VISIBILITY_INTERNAL ServiceVisibility = 2
)

func (ServiceVisibility) Descriptor

func (ServiceVisibility) Enum

func (ServiceVisibility) EnumDescriptor deprecated

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

Deprecated: Use ServiceVisibility.Descriptor instead.

func (ServiceVisibility) Number

func (ServiceVisibility) String

func (x ServiceVisibility) String() string

func (ServiceVisibility) Type

type StoreAs

type StoreAs int32

StoreAs controls how complex or non-scalar protobuf types are persisted in the database.

DEPRECATED — Retired: ignored by forge. SQL is the schema — db/migrations drive entity projections. Column storage types live in migration SQL.

const (
	// Inferred from the protobuf type (default behavior).
	StoreAs_STORE_AS_UNSPECIFIED StoreAs = 0
	// Store as a JSONB column (PostgreSQL) or JSON text (SQLite).
	StoreAs_STORE_AS_JSONB StoreAs = 1
	// Store as a TEXT column.
	StoreAs_STORE_AS_TEXT StoreAs = 2
	// Store as a BLOB / BYTEA column.
	StoreAs_STORE_AS_BLOB StoreAs = 3
	// Store in a separate table with a foreign key relationship.
	StoreAs_STORE_AS_TABLE StoreAs = 4
)

func (StoreAs) Descriptor

func (StoreAs) Descriptor() protoreflect.EnumDescriptor

func (StoreAs) Enum

func (x StoreAs) Enum() *StoreAs

func (StoreAs) EnumDescriptor deprecated

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

Deprecated: Use StoreAs.Descriptor instead.

func (StoreAs) Number

func (x StoreAs) Number() protoreflect.EnumNumber

func (StoreAs) String

func (x StoreAs) String() string

func (StoreAs) Type

func (StoreAs) Type() protoreflect.EnumType

type ValidationRules

type ValidationRules struct {

	// Field value is required (must be non-zero-value).
	Required bool `protobuf:"varint,1,opt,name=required,proto3" json:"required,omitempty"`
	// Minimum length for string fields.
	MinLength int32 `protobuf:"varint,2,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"`
	// Maximum length for string fields.
	MaxLength int32 `protobuf:"varint,3,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"`
	// Regex pattern the value must match.
	Pattern string `protobuf:"bytes,4,opt,name=pattern,proto3" json:"pattern,omitempty"`
	// Semantic format constraint (e.g., "email", "url", "uuid", "ip").
	Format string `protobuf:"bytes,5,opt,name=format,proto3" json:"format,omitempty"`
	// Minimum value for numeric fields.
	Min float64 `protobuf:"fixed64,6,opt,name=min,proto3" json:"min,omitempty"`
	// Maximum value for numeric fields.
	Max float64 `protobuf:"fixed64,7,opt,name=max,proto3" json:"max,omitempty"`
	// Allowed values (for enum-like string fields).
	AllowedValues []string `protobuf:"bytes,8,rep,name=allowed_values,json=allowedValues,proto3" json:"allowed_values,omitempty"`
	// Custom validation function name to call during validation.
	Custom string `protobuf:"bytes,9,opt,name=custom,proto3" json:"custom,omitempty"`
	// contains filtered or unexported fields
}

ValidationRules defines application-layer constraints enforced during code generation. These do not affect the database schema directly.

func (*ValidationRules) Descriptor deprecated

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

Deprecated: Use ValidationRules.ProtoReflect.Descriptor instead.

func (*ValidationRules) GetAllowedValues

func (x *ValidationRules) GetAllowedValues() []string

func (*ValidationRules) GetCustom

func (x *ValidationRules) GetCustom() string

func (*ValidationRules) GetFormat

func (x *ValidationRules) GetFormat() string

func (*ValidationRules) GetMax

func (x *ValidationRules) GetMax() float64

func (*ValidationRules) GetMaxLength

func (x *ValidationRules) GetMaxLength() int32

func (*ValidationRules) GetMin

func (x *ValidationRules) GetMin() float64

func (*ValidationRules) GetMinLength

func (x *ValidationRules) GetMinLength() int32

func (*ValidationRules) GetPattern

func (x *ValidationRules) GetPattern() string

func (*ValidationRules) GetRequired

func (x *ValidationRules) GetRequired() bool

func (*ValidationRules) ProtoMessage

func (*ValidationRules) ProtoMessage()

func (*ValidationRules) ProtoReflect

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

func (*ValidationRules) Reset

func (x *ValidationRules) Reset()

func (*ValidationRules) String

func (x *ValidationRules) String() string

Jump to

Keyboard shortcuts

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