Documentation ¶
Overview ¶
SPDX-License-Identifier: MIT
SPDX-License-Identifier: MIT
SPDX-License-Identifier: MIT
SPDX-License-Identifier: MIT
Index ¶
- Constants
- Variables
- func GetPortFromFile(file string) (uint16, error)
- func Info(info string)
- func ParsePort(fileContent []byte) (uint16, error)
- func PortChangeNotifier(portFile string, throttleTimeMs uint) (chan uint16, chan struct{}, error)
- func PrintError(err error)
- func PrintRequester() (chan StatusUpdate, chan struct{})
- func PrintStepError(err error)
- type Configuration
- type Credentials
- type Request
- type RequestGroup
- type Requester
- type RequesterError
- type StatusUpdate
Constants ¶
View Source
const ( UnInitialized = 0 Success = 1 Error = 2 )
Variables ¶
View Source
var (
ErrRange = errors.New("port out of range")
)
Functions ¶
func GetPortFromFile ¶
WAtch portFile and reparse it when due
func PortChangeNotifier ¶
func PrintError ¶
func PrintError(err error)
func PrintRequester ¶
func PrintRequester() (chan StatusUpdate, chan struct{})
Channel will be closed by requester :/
func PrintStepError ¶
func PrintStepError(err error)
Types ¶
type Configuration ¶
type Credentials ¶
type Request ¶
type Request struct { Method string `mapstructure:"method" validate:"omitempty,oneof=GET POST PUT DELETE OPTION"` Url string `mapstructure:"url" validate:"required,http_url"` ContentType string `mapstructure:"content-type" validate:"required_with=ContentType"` Payload string `mapstructure:"payload" validate:"required_with=ContentType"` }
type RequestGroup ¶
type RequestGroup struct { Credentials Credentials `mapstructure:"credentials"` Requests []Request `mapstructure:"requests" validate:"required,dive"` }
type Requester ¶
type Requester struct {
// contains filtered or unexported fields
}
func NewRequester ¶
func NewRequester() Requester
func NewRequesterWithClient ¶
func (*Requester) SendRequests ¶
func (r *Requester) SendRequests(port uint16, requests map[string]RequestGroup, updateChan chan StatusUpdate) error
type RequesterError ¶
type RequesterError struct {
Errors []error
}
func (*RequesterError) Error ¶
func (m *RequesterError) Error() string
Click to show internal directories.
Click to hide internal directories.