Documentation ¶
Index ¶
- Constants
- func CreateMemberName(clusterName string, member int) string
- func GetCounterFromMemberName(name string) (int, error)
- func IsRetryFailure(err error) bool
- func JsonLogObject(logger *RssLogger, spec interface{}, text string)
- func LogOutput(logger *RssLogger, level logrus.Level, id string, result string)
- func MemberNameFromPeerURL(pu string) (string, error)
- func NewTLSConfig(certData, keyData, caData []byte) (*tls.Config, error)
- func PresentIn(a string, list []string) bool
- func Retry(interval time.Duration, maxRetries int, f ConditionFunc) error
- type ColorScheme
- type ConditionFunc
- type Member
- func (m *Member) Addr() string
- func (m *Member) ClientURL() string
- func (m *Member) Copy() *Member
- func (m Member) IsEqual(other Member) bool
- func (m *Member) ListenClientURL() string
- func (m *Member) ListenPeerURL() string
- func (m *Member) Offline()
- func (m *Member) PeerURL() string
- func (m *Member) Restore(last *Member)
- func (m *Member) String() string
- type MemberSet
- func (ms MemberSet) ActiveMembers() int32
- func (ms MemberSet) Add(m *Member)
- func (ms MemberSet) AppMembers() int32
- func (ms MemberSet) AppPrimaries() int32
- func (ms MemberSet) ClientURLs() []string
- func (ms MemberSet) Copy() MemberSet
- func (ms MemberSet) Diff(other MemberSet) MemberSet
- func (ms MemberSet) DiffExtended(other MemberSet) MemberSet
- func (ms MemberSet) InActiveMembers() int32
- func (ms MemberSet) IsEqual(other MemberSet) bool
- func (ms MemberSet) PeerURLPairs() []string
- func (ms MemberSet) PickOne() *Member
- func (ms MemberSet) Reconcile(running MemberSet, max int32) (MemberSet, error)
- func (ms MemberSet) Remove(name string)
- func (ms MemberSet) Size() int32
- func (ms MemberSet) String() string
- type RetryError
- type RssLogger
- type TextFormatter
Constants ¶
View Source
const ( CliCertFile = "rss-client.crt" CliKeyFile = "rss-client.key" CliCAFile = "rss-client-ca.crt" )
Variables ¶
This section is empty.
Functions ¶
func CreateMemberName ¶
func IsRetryFailure ¶
func JsonLogObject ¶
func MemberNameFromPeerURL ¶
func Retry ¶
func Retry(interval time.Duration, maxRetries int, f ConditionFunc) error
Retry retries f every interval until after maxRetries. The interval won't be affected by how long f takes. For example, if interval is 3s, f takes 1s, another f will be called 2s later. However, if f takes longer than interval, it will be delayed.
Types ¶
type ColorScheme ¶
type ConditionFunc ¶
type Member ¶
type Member struct { Name string // Kubernetes namespace this member runs in. Namespace string SEQ uint64 Failures uint64 Online bool AppPrimary bool AppRunning bool AppFailed bool SecurePeer bool SecureClient bool }
func (*Member) ListenClientURL ¶
func (*Member) ListenPeerURL ¶
type MemberSet ¶
func NewMemberSet ¶
func (MemberSet) ActiveMembers ¶
func (MemberSet) AppMembers ¶
func (MemberSet) AppPrimaries ¶
func (MemberSet) ClientURLs ¶
func (MemberSet) DiffExtended ¶
func (MemberSet) InActiveMembers ¶
func (MemberSet) IsEqual ¶
IsEqual tells whether two member sets are equal by checking - they have the same set of members and member equality are judged by Name only.
func (MemberSet) PeerURLPairs ¶
type RetryError ¶
type RetryError struct {
// contains filtered or unexported fields
}
func (*RetryError) Error ¶
func (e *RetryError) Error() string
type TextFormatter ¶
type TextFormatter struct { // Set to true to bypass checking for a TTY before outputting colors. ForceColors bool // Force disabling colors. For a TTY colors are enabled by default. DisableColors bool // Force formatted layout, even for non-TTY output. ForceFormatting bool // Disable timestamp logging. useful when output is redirected to logging // system that already adds timestamps. DisableTimestamp bool // Disable the conversion of the log levels to uppercase DisableUppercase bool // Enable logging the full timestamp when a TTY is attached instead of just // the time passed since beginning of execution. FullTimestamp bool // Timestamp format to use for display when a full timestamp is printed. TimestampFormat string // The fields are sorted by default for a consistent output. For applications // that log extremely frequently and don't use the JSON formatter this may not // be desired. DisableSorting bool // Wrap empty fields in quotes if true. QuoteEmptyFields bool // Can be set to the override the default quoting character " // with something else. For example: ', or `. QuoteCharacter string // Pad msg field with spaces on the right for display. // The value for this parameter will be the size of padding. // Its default value is zero, which means no padding will be applied for msg. SpacePadding int sync.Once // contains filtered or unexported fields }
func (*TextFormatter) SetColorScheme ¶
func (f *TextFormatter) SetColorScheme(colorScheme *ColorScheme)
Click to show internal directories.
Click to hide internal directories.