result

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

README

result

import "github.com/SuperBuker/terraform-provider-dns-he-net/client/client/result"

Index

func Body

func Body(resp *resty.Response) *html.Node

Returns the parsed HTML body from the go-resty Response. If the Request.Result contains a ResultX, it returns the HTML body from it, otherwise it parses the body and returns the result.

func Init

func Init(resp *resty.Response) (err error)

Init initialises the go-resty Request.Result with a ResultX contaning the parsed HTML body and the expected result, if any. Returns an error if the parsing fails

func Result

func Result(resp *resty.Response) interface{}

Returns the Result() the go-resty Response. If the Request.Result contains a ResultX, it returns the inner Result.

type ResultX

ResultX repurposes go-resty Request.Result to persist a copy of the parsed HTML body. This way we prevent the parsing to be performed on each step of the HTML analysis.

type ResultX struct {
    HTML   *html.Node
    Result interface{}
}

Generated by gomarkdoc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Body

func Body(resp *resty.Response) *html.Node

Returns the parsed HTML body from the go-resty Response. If the Request.Result contains a ResultX, it returns the HTML body from it, otherwise it parses the body and returns the result.

func Init

func Init(resp *resty.Response) (err error)

Init initialises the go-resty Request.Result with a ResultX contaning the parsed HTML body and the expected result, if any. Returns an error if the parsing fails

func Result

func Result(resp *resty.Response) interface{}

Returns the Result() the go-resty Response. If the Request.Result contains a ResultX, it returns the inner Result.

Types

type ResultX

type ResultX struct {
	HTML   *html.Node
	Result interface{}
}

ResultX repurposes go-resty Request.Result to persist a copy of the parsed HTML body. This way we prevent the parsing to be performed on each step of the HTML analysis.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL