Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) GenerateWords() (words, error)
- func (c *Client) GetQuantity() (quantity int)
- func (c *Client) Initialize()
- func (c *Client) ModifyProxy(proxy string) error
- func (c *Client) SetContext(ctx context.Context)
- func (c *Client) SetProxy(proxy string) error
- func (c *Client) SetQuantity(quantity int) error
- func (c *Client) UseProxy() bool
Constants ¶
const (
Version string = "v1.0.0" // exports the current wrapper version
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶ added in v1.0.2
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient() *Client
Initializes a new client with zero values and a dummy context
Use “WithContext“ instead to use your own context
func WithContext ¶
This function can be used to initialize a new client with a given context
func (*Client) GenerateWords ¶ added in v1.0.2
This method can be used to generate random words
If a context with a timeout or cancellation is provided, when the cancellation or timeout occurs, it will immediately cancel and return.
func (*Client) GetQuantity ¶ added in v1.0.2
Gets the current set quantity
func (*Client) Initialize ¶ added in v1.0.2
func (c *Client) Initialize()
Initialize, must be called before starting fetching words
func (*Client) ModifyProxy ¶ added in v1.0.2
Modifies the proxy, if this is called after Initialize it has no effect
func (*Client) SetContext ¶ added in v1.0.2
Sets the given context to the client, it can be used to modify but that is not recommended
func (*Client) SetProxy ¶ added in v1.0.2
Sets the proxy to use while connecting and gathering data from the script utility hosted on randomwordgenerator.com
This method needs to be called before the initialize method
func (*Client) SetQuantity ¶ added in v1.0.2
Sets the quantity which determines how many words will be generated at once at a time “quantity“ can not be more than 50.