auth

package
Version: v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2020 License: MIT Imports: 9 Imported by: 0

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

type AutoAuthData struct {
	Name      string
	Encrypted bool
	Save      []string
	IsRunning bool
	Try       int
}

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

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL