Documentation ¶
Index ¶
- Variables
- type Region
- type RoutingSpec
- func (*RoutingSpec) Descriptor() ([]byte, []int)deprecated
- func (x *RoutingSpec) GetExecuteOnOwningRegion() bool
- func (x *RoutingSpec) GetRegionIdFieldPaths() []string
- func (x *RoutingSpec) GetResourceFieldPaths() []string
- func (x *RoutingSpec) GetScopeFieldPaths() []string
- func (x *RoutingSpec) GetSkipCodeGenBasedRouting() bool
- func (*RoutingSpec) ProtoMessage()
- func (x *RoutingSpec) ProtoReflect() protoreflect.Message
- func (x *RoutingSpec) Reset()
- func (x *RoutingSpec) String() string
- type SyncingOpts
- type SyncingOpts_Type
- func (SyncingOpts_Type) Descriptor() protoreflect.EnumDescriptor
- func (x SyncingOpts_Type) Enum() *SyncingOpts_Type
- func (SyncingOpts_Type) EnumDescriptor() ([]byte, []int)deprecated
- func (x SyncingOpts_Type) Number() protoreflect.EnumNumber
- func (x SyncingOpts_Type) String() string
- func (SyncingOpts_Type) Type() protoreflect.EnumType
Constants ¶
This section is empty.
Variables ¶
var ( SyncingOpts_Type_name = map[int32]string{ 0: "DEFAULT", 1: "ALWAYS_IN_SCOPE", 2: "NEVER", 3: "ALWAYS_GLOBALLY", } SyncingOpts_Type_value = map[string]int32{ "DEFAULT": 0, "ALWAYS_IN_SCOPE": 1, "NEVER": 2, "ALWAYS_GLOBALLY": 3, } )
Enum value maps for SyncingOpts_Type.
var ( // Routing specification for this method. // // optional goten.annotations.RoutingSpec multi_region_routing = 79041; E_MultiRegionRouting = &file_goten_annotations_multi_region_proto_extTypes[0] )
Extension fields to descriptorpb.MethodOptions.
var (
// optional goten.annotations.SyncingOpts syncing_opts = 69100;
E_SyncingOpts = &file_goten_annotations_multi_region_proto_extTypes[1]
)
Extension fields to descriptorpb.MessageOptions.
var File_goten_annotations_multi_region_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Region ¶
type Region struct {
// contains filtered or unexported fields
}
Region is a scope attribute annotation that should be added to each resource that is supposed to be regional. With this, goten will add region segment to the owning resource each name pattern.
func (*Region) Descriptor
deprecated
func (*Region) ProtoMessage ¶
func (*Region) ProtoMessage()
func (*Region) ProtoReflect ¶
func (x *Region) ProtoReflect() protoreflect.Message
type RoutingSpec ¶
type RoutingSpec struct { // If true, goten will omit multi-region code-generation for given method. It // can be used when its known that method does not need to be routed or if // developer needs to write custom code manually. // If this option is set, other fields are ignored. SkipCodeGenBasedRouting bool `` /* 137-byte string literal not displayed */ // Informs goten code-gen that given method can only be executed on region // owning resource on each method operates. Its typically used for write requests. ExecuteOnOwningRegion bool `` /* 129-byte string literal not displayed */ // List of field paths in a request containing resource scope - reference // to resource which contains multi-region Policy object in its schema. // Routing mechanisms gets scoping resource, extracts Policy object and // having it, makes decision whether request can be executed locally, or // whether it should be routed somewhere else, or maybe if it should be // splitted across many regions. // This field is used only for methods operating on collection of // resources and if region_id_field_paths is not provided (has higher // priority). // If not provided, then Goten will look into request_paths annotation // in the method protobuf definition. If this is missing and defaults // cannot be deduced, error will be raised. // Because request can use oneof and contain many potential field // paths, this field is an array. However, routing mechanism picks only // first populated value. ScopeFieldPaths []string `protobuf:"bytes,3,rep,name=scope_field_paths,json=scopeFieldPaths,proto3" json:"scope_field_paths,omitempty"` // List of field paths in a request which contain reference/name to a resource // on which method operates. Routing mechanisms determines what is the // ancestor holding multi-region Policy for given reference (if exists) and // eventually determines if request should be routed or executed locally. // This field is used only for methods operating on single resources and if // region_id_field_paths is not provided (has higher priority). // If not provided, then Goten will look into request_paths annotation // in the method protobuf definition. If this is missing and defaults // cannot be deduced, error will be raised. // Because request can use oneof and contain many potential field // paths, this field is an array. However, routing mechanism picks only // first populated value. ResourceFieldPaths []string `protobuf:"bytes,4,rep,name=resource_field_paths,json=resourceFieldPaths,proto3" json:"resource_field_paths,omitempty"` // List of field paths in a request containing exact region ID where // request should be routed. This mechanism can be used if routing cannot // be decided easier using scope or resource name/ref, but should be generally // avoided. RegionIdFieldPaths []string `protobuf:"bytes,5,rep,name=region_id_field_paths,json=regionIdFieldPaths,proto3" json:"region_id_field_paths,omitempty"` // contains filtered or unexported fields }
RoutingSpec is attachable to method and provides routing information for it. It is generally generated by bootstrap based on api skeleton code.
func (*RoutingSpec) Descriptor
deprecated
func (*RoutingSpec) Descriptor() ([]byte, []int)
Deprecated: Use RoutingSpec.ProtoReflect.Descriptor instead.
func (*RoutingSpec) GetExecuteOnOwningRegion ¶
func (x *RoutingSpec) GetExecuteOnOwningRegion() bool
func (*RoutingSpec) GetRegionIdFieldPaths ¶
func (x *RoutingSpec) GetRegionIdFieldPaths() []string
func (*RoutingSpec) GetResourceFieldPaths ¶
func (x *RoutingSpec) GetResourceFieldPaths() []string
func (*RoutingSpec) GetScopeFieldPaths ¶
func (x *RoutingSpec) GetScopeFieldPaths() []string
func (*RoutingSpec) GetSkipCodeGenBasedRouting ¶
func (x *RoutingSpec) GetSkipCodeGenBasedRouting() bool
func (*RoutingSpec) ProtoMessage ¶
func (*RoutingSpec) ProtoMessage()
func (*RoutingSpec) ProtoReflect ¶
func (x *RoutingSpec) ProtoReflect() protoreflect.Message
func (*RoutingSpec) Reset ¶
func (x *RoutingSpec) Reset()
func (*RoutingSpec) String ¶
func (x *RoutingSpec) String() string
type SyncingOpts ¶
type SyncingOpts struct { // Synchronization type indicates where resources of given type are synced. Type SyncingOpts_Type `protobuf:"varint,1,opt,name=type,proto3,enum=goten.annotations.SyncingOpts_Type" json:"type,omitempty"` // contains filtered or unexported fields }
SyncingOpts is attachable to goten resource and carries additional information how resource is synced across regions.
func (*SyncingOpts) Descriptor
deprecated
func (*SyncingOpts) Descriptor() ([]byte, []int)
Deprecated: Use SyncingOpts.ProtoReflect.Descriptor instead.
func (*SyncingOpts) GetType ¶
func (x *SyncingOpts) GetType() SyncingOpts_Type
func (*SyncingOpts) ProtoMessage ¶
func (*SyncingOpts) ProtoMessage()
func (*SyncingOpts) ProtoReflect ¶
func (x *SyncingOpts) ProtoReflect() protoreflect.Message
func (*SyncingOpts) Reset ¶
func (x *SyncingOpts) Reset()
func (*SyncingOpts) String ¶
func (x *SyncingOpts) String() string
type SyncingOpts_Type ¶
type SyncingOpts_Type int32
const ( // DEFAULT indicates, that resource is synced according to policy and its // rules if it is a subject of policy. Otherwise, it is synced always to all // possible regions (ALWAYS_GLOBALLY). SyncingOpts_DEFAULT SyncingOpts_Type = 0 // ALWAYS_IN_SCOPE indicates that resource is always synced across all regions according // to MultiRegionPolicy of the parent (enabled regions). If resource is not // subject to MultiRegionPolicy, it is synced to all regions globally (same as // ALWAYS_GLOBALLY). SyncingOpts_ALWAYS_IN_SCOPE SyncingOpts_Type = 1 // NEVER indicates that resource never is synced outside its owning region. // Only resources that are subject to policies can be never synced. SyncingOpts_NEVER SyncingOpts_Type = 2 // ALWAYS_GLOBALLY indicates that resource ignores MultiRegionPolicy of parent // and is synced always globally, to all regions supported by service. SyncingOpts_ALWAYS_GLOBALLY SyncingOpts_Type = 3 )
func (SyncingOpts_Type) Descriptor ¶
func (SyncingOpts_Type) Descriptor() protoreflect.EnumDescriptor
func (SyncingOpts_Type) Enum ¶
func (x SyncingOpts_Type) Enum() *SyncingOpts_Type
func (SyncingOpts_Type) EnumDescriptor
deprecated
func (SyncingOpts_Type) EnumDescriptor() ([]byte, []int)
Deprecated: Use SyncingOpts_Type.Descriptor instead.
func (SyncingOpts_Type) Number ¶
func (x SyncingOpts_Type) Number() protoreflect.EnumNumber
func (SyncingOpts_Type) String ¶
func (x SyncingOpts_Type) String() string
func (SyncingOpts_Type) Type ¶
func (SyncingOpts_Type) Type() protoreflect.EnumType