package clientimport ()// Settings holds optional client settings.typeSettingsstruct { disablePAFXFast bool assumePreAuthentication bool preAuthEType int32 logger *log.Logger}// jsonSettings is used when marshaling the Settings details to JSON format.type jsonSettings struct { DisablePAFXFast bool AssumePreAuthentication bool}// NewSettings creates a new client settings struct.func ( ...func(*Settings)) *Settings { := new(Settings)for , := range { () }return}// DisablePAFXFAST used to configure the client to not use PA_FX_FAST.//// s := NewSettings(DisablePAFXFAST(true))func ( bool) func(*Settings) {returnfunc( *Settings) { .disablePAFXFast = }}// DisablePAFXFAST indicates is the client should disable the use of PA_FX_FAST.func ( *Settings) () bool {return .disablePAFXFast}// AssumePreAuthentication used to configure the client to assume pre-authentication is required.//// s := NewSettings(AssumePreAuthentication(true))func ( bool) func(*Settings) {returnfunc( *Settings) { .assumePreAuthentication = }}// AssumePreAuthentication indicates if the client should proactively assume using pre-authentication.func ( *Settings) () bool {return .assumePreAuthentication}// Logger used to configure client with a logger.//// s := NewSettings(kt, Logger(l))func ( *log.Logger) func(*Settings) {returnfunc( *Settings) { .logger = }}// Logger returns the client logger instance.func ( *Settings) () *log.Logger {return .logger}// Log will write to the service's logger if it is configured.func ( *Client) ( string, ...interface{}) {if .settings.Logger() != nil { .settings.Logger().Output(2, fmt.Sprintf(, ...)) }}// JSON returns a JSON representation of the settings.func ( *Settings) () (string, error) { := jsonSettings{DisablePAFXFast: .disablePAFXFast,AssumePreAuthentication: .assumePreAuthentication, } , := json.MarshalIndent(, "", " ")if != nil {return"", }returnstring(), nil}
The pages are generated with Goldsv0.6.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.