Documentation ¶
Index ¶
- func RegisterPlug(p RoundTripPlug)
- type LogOnce_type
- func (lo *LogOnce_type) Debugf(format string, args ...interface{})
- func (lo *LogOnce_type) Errorf(format string, args ...interface{})
- func (lo *LogOnce_type) Infof(format string, args ...interface{})
- func (lo *LogOnce_type) Sync() error
- func (lo *LogOnce_type) Warnf(format string, args ...interface{})
- type Logger
- type RoundTripPlug
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterPlug ¶
func RegisterPlug(p RoundTripPlug)
RegisterPlug() is called from init() function of plugs
Types ¶
type LogOnce_type ¶ added in v0.5.0
type LogOnce_type struct {
// contains filtered or unexported fields
}
func (*LogOnce_type) Debugf ¶ added in v0.5.0
func (lo *LogOnce_type) Debugf(format string, args ...interface{})
func (*LogOnce_type) Errorf ¶ added in v0.5.0
func (lo *LogOnce_type) Errorf(format string, args ...interface{})
func (*LogOnce_type) Infof ¶ added in v0.5.0
func (lo *LogOnce_type) Infof(format string, args ...interface{})
func (*LogOnce_type) Sync ¶ added in v0.5.0
func (lo *LogOnce_type) Sync() error
func (*LogOnce_type) Warnf ¶ added in v0.5.0
func (lo *LogOnce_type) Warnf(format string, args ...interface{})
type Logger ¶
type Logger interface { Debugf(format string, args ...interface{}) Infof(format string, args ...interface{}) Warnf(format string, args ...interface{}) Errorf(format string, args ...interface{}) Sync() error }
Any logger of this interface can be used by rtplugs and all connected plugs
var Log Logger
The logger for the rtplugs and all connected plugs
var LogOnce Logger
type RoundTripPlug ¶
type RoundTripPlug interface { Init(ctx context.Context, config map[string]string, serviceName string, namespace string, logger Logger) context.Context Shutdown() PlugName() string PlugVersion() string ApproveRequest(*http.Request) (*http.Request, error) ApproveResponse(*http.Request, *http.Response) (*http.Response, error) }
A plugin based on the newer RoundTripPlug supports offers this interface
The plugin will have a function
func NewPlug() RoundTripPlug {}
func GetPlug ¶
func GetPlug() RoundTripPlug
GetPlug() is called by implementations supporting a single plug
func GetPlugByName ¶
func GetPlugByName(name string) RoundTripPlug
GetPlugByName() is called by implementatuions supporting multiple plugs
Click to show internal directories.
Click to hide internal directories.