Documentation ¶
Index ¶
- Variables
- func CaptureLogs(c chan<- Param)
- func DecodeOther(other, cc interface{}) error
- func DefaultPort(conn string, port int) string
- func DefaultScheme(uri, scheme string) string
- func Flusher() flush
- func FormatValue(format string, val interface{}) string
- func Getenv(key string, def ...string) string
- func LocalIPs() (ips []net.IPNet)
- func LogLevel(defaultLevel string, areaLevels map[string]string)
- func LogLevelForArea(area string) jww.Threshold
- func LogLevelToThreshold(level string) jww.Threshold
- func Loggers(cb func(string, *Logger))
- func RedactDefaultHook(s string) []string
- func ReplaceFormatted(s string, kv map[string]interface{}) (string, error)
- func SignFromPower(current float64, power float64) float64
- func Truish(s string) bool
- type AuthCollection
- type AuthProvider
- type Cache
- type ConfigError
- type Logger
- type Param
- type Queue
- type Redactor
- type State
- type Tee
- type TeeAttacher
- type Waiter
Constants ¶
This section is empty.
Variables ¶
var ( // OutThreshold is the default console log level OutThreshold = jww.LevelError // LogThreshold is the default log file level LogThreshold = jww.LevelWarn )
var ( // RedactReplacement is the default replacement string RedactReplacement = "***" // RedactHook is the hook for expanding different representations of // redaction items. Setting to nil will disable redaction. RedactHook = RedactDefaultHook )
var ErrStateExpired = fmt.Errorf("state expired")
var LogAreaPadding = 6
LogAreaPadding of log areas
Functions ¶
func CaptureLogs ¶
func CaptureLogs(c chan<- Param)
CaptureLogs appends uiWriter to relevant log levels for loggers created before uiChan is initialized
func DecodeOther ¶
func DecodeOther(other, cc interface{}) error
DecodeOther uses mapstructure to decode into target structure. Unused keys cause errors.
func DefaultPort ¶
DefaultPort appends given port to connection if not specified
func DefaultScheme ¶
DefaultScheme prepends given scheme to uri if not specified
func FormatValue ¶
FormatValue will apply specific formatting in addition to standard sprintf
func LogLevelForArea ¶
LogLevelForArea gets the log level for given log area
func LogLevelToThreshold ¶
LogLevelToThreshold converts log level string to a jww Threshold
func RedactDefaultHook ¶
RedactDefaultHook expands a redaction item to include URL encoding
func ReplaceFormatted ¶
ReplaceFormatted replaces all occurrences of ${key} with formatted val from the kv map
func SignFromPower ¶
SignFromPower is a helper function to create signed current from signed power bypassing already signed current
Types ¶
type AuthCollection ¶
type AuthCollection struct {
// contains filtered or unexported fields
}
func NewAuthCollection ¶
func NewAuthCollection(paramC chan<- Param) *AuthCollection
func (*AuthCollection) Register ¶
func (ac *AuthCollection) Register(baseURI, title string) *AuthProvider
type AuthProvider ¶
type AuthProvider struct { Uri string `json:"uri"` Authenticated bool `json:"authenticated"` // contains filtered or unexported fields }
func (*AuthProvider) Handler ¶
func (ap *AuthProvider) Handler() chan<- bool
type ConfigError ¶
type ConfigError struct {
// contains filtered or unexported fields
}
ConfigError wraps yaml configuration errors from mapstructure
func (*ConfigError) Error ¶
func (e *ConfigError) Error() string
func (*ConfigError) Unwrap ¶
func (e *ConfigError) Unwrap() error
type Logger ¶
Logger wraps a jww notepad to avoid leaking implementation detail
func NewLoggerWithLoadpoint ¶
NewLoggerWithLoadpoint creates a logger with reference to at loadpoint
type Queue ¶
type Queue[T any] struct { // contains filtered or unexported fields }
Queue is based on https://github.com/golang-ds/queue
func (*Queue[T]) Dequeue ¶
Dequeue removes and returns the front element of the queue. It returns false if the queue was empty.
func (*Queue[T]) Enqueue ¶
func (q *Queue[T]) Enqueue(data T)
Enqueue adds an element to the end of the queue.
func (*Queue[T]) First ¶
First returns the front element of the queue. It returns false if the queue was empty.
type Redactor ¶
type Redactor struct {
// contains filtered or unexported fields
}
Redactor implements a redacting io.Writer
type Tee ¶
type Tee struct {
// contains filtered or unexported fields
}
Tee distributes parameters to subscribers
type TeeAttacher ¶
type TeeAttacher interface {
Attach() <-chan Param
}
TeeAttacher allows attaching a listener to a tee
type Waiter ¶
type Waiter struct {
// contains filtered or unexported fields
}
Waiter provides monitoring of receive timeouts and reception of initial value
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package goversion should only be used as a blank import.
|
Package goversion should only be used as a blank import. |
Package shortrfc3339 implements helpers for working with shortened RFC-3339 compliant timestamps (those without seconds).
|
Package shortrfc3339 implements helpers for working with shortened RFC-3339 compliant timestamps (those without seconds). |
Package urlvalues provides functions for working with url.Values
|
Package urlvalues provides functions for working with url.Values |