Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutoAuthBaseReuqest ¶ added in v1.2.2
type AutoAuthBaseReuqest struct { Endpoint string Method string Header []string Body []string Timeout time.Duration }
AutoAuthBaseReuqest is base struct contain data to create request
type AutoAuthData ¶ added in v1.2.2
AutoAuthData contain data for AutoAuth struct
type AutoAuthHeartbeat ¶
type AutoAuthHeartbeat struct { AutoAuthBaseReuqest `mapstructure:",squash"` Interval time.Duration Retry int }
AutoAuthHeartbeat contain heartbeat preset
type AutoAuthLogin ¶
type AutoAuthLogin struct {
AutoAuthBaseReuqest `mapstructure:",squash"`
}
AutoAuthLogin contain login preset
type AutoAuthLogout ¶
type AutoAuthLogout struct {
AutoAuthBaseReuqest `mapstructure:",squash"`
}
AutoAuthLogout contain logout preset
type AutoAuthPreset ¶
type AutoAuthPreset struct { AutoAuthData `mapstructure:",squash"` Login AutoAuthLogin Logout AutoAuthLogout Heartbeat AutoAuthHeartbeat }
AutoAuthPreset is base struct contain all configuration of preset file
func LoadPresetFromPath ¶
func LoadPresetFromPath(dir string, fileName string) AutoAuthPreset
LoadPresetFromPath will load preset from path and return it
func (*AutoAuthPreset) IsHeartbeatAlive ¶ added in v1.3.1
func (preset *AutoAuthPreset) IsHeartbeatAlive() error
IsHeartbeatAlive send request to heartbeat endpoint and return status of request
func (*AutoAuthPreset) RequestLogin ¶
func (preset *AutoAuthPreset) RequestLogin() error
RequestLogin will create request to authentication service
func (*AutoAuthPreset) RequestLogout ¶
func (preset *AutoAuthPreset) RequestLogout() error
RequestLogout send logout request
func (AutoAuthPreset) StartAutoLogin ¶
func (preset AutoAuthPreset) StartAutoLogin(sig chan os.Signal)
StartAutoLogin will start corutine to detect internet connection and send login request.
func (AutoAuthPreset) StopAutoLogin ¶
func (preset AutoAuthPreset) StopAutoLogin()
StopAutoLogin will stop AutoAuth
type MainAutoAuthPreset ¶ added in v1.2.2
type MainAutoAuthPreset struct {
AutoAuth AutoAuthPreset `mapstructure:"autoauth"`
}
MainAutoAuthPreset is used to map to preset file like yml or json file