Documentation ¶
Index ¶
- Constants
- func SanityCheck(miid string) bool
- type Ciid
- type IOption
- type IRequest
- func (r IRequest) GetHeader() string
- func (r IRequest) GetIidAuth() string
- func (r IRequest) HasKey() bool
- func (r IRequest) HasOptions() bool
- func (r IRequest) Options() Options
- func (r *IRequest) SetIidAuth(id string) IidRequest
- func (r *IRequest) SetOption(o Option) IidRequest
- func (r IRequest) String() string
- type IidRequest
- type Miid
- type Option
- type Options
- type Stack
- type StdCiid
- func (c StdCiid) Ciids() Stack
- func (m StdCiid) ClearStack() StdCiid
- func (c StdCiid) Contains(miid string) bool
- func (c StdCiid) Miid() Miid
- func (c *StdCiid) SetCiids(s Stack) Ciid
- func (ciid *StdCiid) SetEpoch(startTime time.Time) Ciid
- func (m StdCiid) SetStack(callStack Stack) StdCiid
- func (c StdCiid) String() string
- func (c StdCiid) TreePrint() string
- type StdMiid
Examples ¶
Constants ¶
const XINSTANCEID = "X-Instance-Id"
Std header-name for HTTP-Requests
Variables ¶
This section is empty.
Functions ¶
func SanityCheck ¶
SanityCheck checks the given miid against some rules to ensure that it can be an Miid returns true if miid could be an Miid false otherwise
Types ¶
type Ciid ¶
type Ciid interface { // Returns the miid part of the ciids Miid() Miid // Returns the call stack Ciids() Stack // Returns the canoncical instance id representation String() string // Sets the epoch to now, with time being startTime of service. Chainable SetEpoch(time.Time) Ciid // Sets the call stack. Chainable SetCiids(Stack) Ciid }
Defines the capabilities of a CIID
type IRequest ¶
type IRequest struct {
// contains filtered or unexported fields
}
Example ¶
iir := IRequest{} iir.SetOption( IOption{ commandName: "v", }, ).SetIidAuth("caffee") fmt.Println("String: " + iir.String()) fmt.Println("IdAuth: " + iir.GetIidAuth())
Output: String: key=caffee options=v IdAuth: caffee
func NewIRequestFromString ¶
NewIRequestFromString creates a new IRequest from a value header passed as string
Example ¶
// Create a new Request object with no auth key and some options iir := NewIRequestFromString("empty options=cv") fmt.Println("String: " + iir.String()) fmt.Println("IdAuth: " + iir.GetIidAuth()) fmt.Println("Header: " + iir.GetHeader())
Output: String: empty options=cv IdAuth: empty Header: X-Instance-Id: empty options=cv
func (IRequest) GetIidAuth ¶
GetIidAuth returns the authorisation key value, or an empty string if not set.
func (IRequest) HasKey ¶
HasKey returns true, if a key element was present. False if empty, or no keys at all
func (IRequest) HasOptions ¶
HasOptions returns true, in case options have been indicated, false otherwise
func (*IRequest) SetIidAuth ¶
func (r *IRequest) SetIidAuth(id string) IidRequest
SetIidAuth set's the authorisation key value. Chainable Value xyz is included literally as key=xyz If empty string is passed no authorisation key will be send
func (*IRequest) SetOption ¶
func (r *IRequest) SetOption(o Option) IidRequest
SetOption sets an option for the Iid-Request header. Chainable
type IidRequest ¶
type IidRequest interface { // SetIidAuth set's the authorisation key value. Chainable // Value xyz is included literally as key=xyz // If empty string is passed no authorisation key will be send SetIidAuth(string) IidRequest // GetIidAuth returns the authorisation key value, or an empty string if not set. GetIidAuth() string // Options returns the options set Options() Options // HasOptions returns true, in case options have been indicated, false otherwise HasOptions() bool // HasKey returns true, if a key element was present. False if empty, or no keys at all HasKey() bool // SetOption sets an option for the Iid-Request header. Chainable SetOption(Option) IidRequest // String returns the canonical iid-request value string represenation String() string // GetHeader returns the canonical iid-request Header string represenation GetHeader() string }
type Miid ¶
type Miid interface { // Returns the service name Sn() string // Retunrs the version number Vn() string // Returns the application specific part of the miid Va() string // Returns the epoch of the miid T() int // Returns the canoncical instance id representation String() string // Sets the epoch of the miid in s. Chainable SetT(int) Miid // Sets the epoch to now, with time being startTime of service. Chainable SetEpoch(time.Time) Miid }
Defines the capabilities of a MIID
type Stack ¶
type Stack []Ciid
Stack represents a list of services that have been called by the Ciid
type StdCiid ¶
type StdCiid struct {
// contains filtered or unexported fields
}
func NewStdCiid ¶
NewCiid creates a new Ciid from a string in the form of Sn1/Vn1/Va1%t1s(Sn2/Vn2/Va2%t2s+Sn3/Vn3/Va3%t3s(Sn4/Vn4/Va4%t4s))
func (StdCiid) ClearStack ¶
func (StdCiid) Contains ¶
Contains returns true if the Ciid contains the left aligned miid as part of the call graph
type StdMiid ¶
type StdMiid struct {
// contains filtered or unexported fields
}
func NewStdMiid ¶
func (StdMiid) Contains ¶
Contains returns true if s is contained left aligned, else or if s is empty return false