Routing tags are part of a context. Rules to match tags when looking for a suitable target service instance are as follows:
If FallbackToPlain == false then:
- if context has no tags - use any instance
- if context has tags - only use instance that matches exactly (with all tags)
If FallbackToPlain == true then:
- if context has no tags - use any instance
- if context has tags - if at least one instance matches exactly (with all tags), use only that. if none matches, but at least one instance has no tags, use that.
Propagate: If it is true, the routing tags are kept as-is, otherwise the first target service will strip routing tags out
type CTXRoutingTags struct {
Tags map[string]string `protobuf:"bytes,1,rep,name=Tags" json:"Tags,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
FallbackToPlain bool `protobuf:"varint,2,opt,name=FallbackToPlain" json:"FallbackToPlain,omitempty"`
Propagate bool `protobuf:"varint,3,opt,name=Propagate" json:"Propagate,omitempty"`
}
func (*CTXRoutingTags) Descriptor() ([]byte, []int)
func (m *CTXRoutingTags) GetFallbackToPlain() bool
func (m *CTXRoutingTags) GetPropagate() bool
func (m *CTXRoutingTags) GetTags() map[string]string
func (*CTXRoutingTags) ProtoMessage()
func (m *CTXRoutingTags) Reset()
func (m *CTXRoutingTags) String() string
parsed on boot
type Config struct {
Registry string `protobuf:"bytes,1,opt,name=Registry" json:"Registry,omitempty"`
}
func (*Config) Descriptor() ([]byte, []int)
func (m *Config) GetRegistry() string
func (*Config) ProtoMessage()
func (m *Config) Reset()
func (m *Config) String() string
type Experiment struct {
Name string `protobuf:"bytes,1,opt,name=Name" json:"Name,omitempty"`
Enabled bool `protobuf:"varint,2,opt,name=Enabled" json:"Enabled,omitempty"`
}
func (*Experiment) Descriptor() ([]byte, []int)
func (m *Experiment) GetEnabled() bool
func (m *Experiment) GetName() string
func (*Experiment) ProtoMessage()
func (m *Experiment) Reset()
func (m *Experiment) String() string
type GRPCError struct {
UserMessage string `protobuf:"bytes,1,opt,name=UserMessage" json:"UserMessage,omitempty"`
LogMessage string `protobuf:"bytes,2,opt,name=LogMessage" json:"LogMessage,omitempty"`
MethodName string `protobuf:"bytes,3,opt,name=MethodName" json:"MethodName,omitempty"`
ServiceName string `protobuf:"bytes,4,opt,name=ServiceName" json:"ServiceName,omitempty"`
CallingServiceID string `protobuf:"bytes,5,opt,name=CallingServiceID" json:"CallingServiceID,omitempty"`
CallingServiceEmail string `protobuf:"bytes,6,opt,name=CallingServiceEmail" json:"CallingServiceEmail,omitempty"`
}
func (*GRPCError) Descriptor() ([]byte, []int)
func (m *GRPCError) GetCallingServiceEmail() string
func (m *GRPCError) GetCallingServiceID() string
func (m *GRPCError) GetLogMessage() string
func (m *GRPCError) GetMethodName() string
func (m *GRPCError) GetServiceName() string
func (m *GRPCError) GetUserMessage() string
func (*GRPCError) ProtoMessage()
func (m *GRPCError) Reset()
func (m *GRPCError) String() string
a single error can only hold a single proto
type GRPCErrorList struct {
Errors []*GRPCError `protobuf:"bytes,1,rep,name=Errors" json:"Errors,omitempty"`
}
func (*GRPCErrorList) Descriptor() ([]byte, []int)
func (m *GRPCErrorList) GetErrors() []*GRPCError
func (*GRPCErrorList) ProtoMessage()
func (m *GRPCErrorList) Reset()
func (m *GRPCErrorList) String() string
this must not be changed throughout its lifetime. furthermore, go-easyops _must_ transport this as-is (preserving unknown fields)
type ImmutableContext struct {
RequestID string `protobuf:"bytes,1,opt,name=RequestID" json:"RequestID,omitempty"`
CreatorService *auth.SignedUser `protobuf:"bytes,2,opt,name=CreatorService" json:"CreatorService,omitempty"`
User *auth.SignedUser `protobuf:"bytes,3,opt,name=User" json:"User,omitempty"`
SudoUser *auth.SignedUser `protobuf:"bytes,4,opt,name=SudoUser" json:"SudoUser,omitempty"`
Session *session.Session `protobuf:"bytes,5,opt,name=Session" json:"Session,omitempty"`
AuthTags []string `protobuf:"bytes,6,rep,name=AuthTags" json:"AuthTags,omitempty"`
}
func (*ImmutableContext) Descriptor() ([]byte, []int)
func (m *ImmutableContext) GetAuthTags() []string
func (m *ImmutableContext) GetCreatorService() *auth.SignedUser
func (m *ImmutableContext) GetRequestID() string
func (m *ImmutableContext) GetSession() *session.Session
func (m *ImmutableContext) GetSudoUser() *auth.SignedUser
func (m *ImmutableContext) GetUser() *auth.SignedUser
func (*ImmutableContext) ProtoMessage()
func (m *ImmutableContext) Reset()
func (m *ImmutableContext) String() string
this is transported within the Context of a call. This proto is on-purpose very brief and static so that old versions of go-easyops can handle it
type InContext struct {
ImCtx *ImmutableContext `protobuf:"bytes,1,opt,name=ImCtx" json:"ImCtx,omitempty"`
MCtx *MutableContext `protobuf:"bytes,2,opt,name=MCtx" json:"MCtx,omitempty"`
}
func (*InContext) Descriptor() ([]byte, []int)
func (m *InContext) GetImCtx() *ImmutableContext
func (m *InContext) GetMCtx() *MutableContext
func (*InContext) ProtoMessage()
func (m *InContext) Reset()
func (m *InContext) String() string
this may change. fields are not guaranteed to be preserved
type MutableContext struct {
CallingService *auth.SignedUser `protobuf:"bytes,1,opt,name=CallingService" json:"CallingService,omitempty"`
Debug bool `protobuf:"varint,2,opt,name=Debug" json:"Debug,omitempty"`
Trace bool `protobuf:"varint,3,opt,name=Trace" json:"Trace,omitempty"`
Tags *CTXRoutingTags `protobuf:"bytes,4,opt,name=Tags" json:"Tags,omitempty"`
ServiceIDs []string `protobuf:"bytes,5,rep,name=ServiceIDs" json:"ServiceIDs,omitempty"`
Experiments []*Experiment `protobuf:"bytes,6,rep,name=Experiments" json:"Experiments,omitempty"`
Services []*ServiceTrace `protobuf:"bytes,7,rep,name=Services" json:"Services,omitempty"`
}
func (*MutableContext) Descriptor() ([]byte, []int)
func (m *MutableContext) GetCallingService() *auth.SignedUser
func (m *MutableContext) GetDebug() bool
func (m *MutableContext) GetExperiments() []*Experiment
func (m *MutableContext) GetServiceIDs() []string
func (m *MutableContext) GetServices() []*ServiceTrace
func (m *MutableContext) GetTags() *CTXRoutingTags
func (m *MutableContext) GetTrace() bool
func (*MutableContext) ProtoMessage()
func (m *MutableContext) Reset()
func (m *MutableContext) String() string
a postgres configuration
type PostgresConfig struct {
Host string `protobuf:"bytes,1,opt,name=Host" json:"Host,omitempty"`
DB string `protobuf:"bytes,2,opt,name=DB" json:"DB,omitempty"`
User string `protobuf:"bytes,3,opt,name=User" json:"User,omitempty"`
PW string `protobuf:"bytes,4,opt,name=PW" json:"PW,omitempty"`
MaxConnections uint32 `protobuf:"varint,5,opt,name=MaxConnections" json:"MaxConnections,omitempty"`
MaxIdleSecs uint32 `protobuf:"varint,6,opt,name=MaxIdleSecs" json:"MaxIdleSecs,omitempty"`
}
func (*PostgresConfig) Descriptor() ([]byte, []int)
func (m *PostgresConfig) GetDB() string
func (m *PostgresConfig) GetHost() string
func (m *PostgresConfig) GetMaxConnections() uint32
func (m *PostgresConfig) GetMaxIdleSecs() uint32
func (m *PostgresConfig) GetPW() string
func (m *PostgresConfig) GetUser() string
func (*PostgresConfig) ProtoMessage()
func (m *PostgresConfig) Reset()
func (m *PostgresConfig) String() string
each service that receives an RPC adds itself to the servicetrace, potentially with a stacktrace or so
type ServiceTrace struct {
ID string `protobuf:"bytes,1,opt,name=ID" json:"ID,omitempty"`
}
func (*ServiceTrace) Descriptor() ([]byte, []int)
func (m *ServiceTrace) GetID() string
func (*ServiceTrace) ProtoMessage()
func (m *ServiceTrace) Reset()
func (m *ServiceTrace) String() string
send in response to unixipc STOPREQUEST
type StopUpdate struct {
Stopping bool `protobuf:"varint,1,opt,name=Stopping" json:"Stopping,omitempty"`
ActiveRPCs uint32 `protobuf:"varint,2,opt,name=ActiveRPCs" json:"ActiveRPCs,omitempty"`
}
func (*StopUpdate) Descriptor() ([]byte, []int)
func (m *StopUpdate) GetActiveRPCs() uint32
func (m *StopUpdate) GetStopping() bool
func (*StopUpdate) ProtoMessage()
func (m *StopUpdate) Reset()
func (m *StopUpdate) String() string