Documentation ¶
Index ¶
- Constants
- type AutoLogin
- type Client
- func (c *Client) Init(cred mmf.Credentials, rc *resty.Client) *Client
- func (c *Client) J(referer string, args ...interface{}) *resty.Request
- func (c *Client) Pages(n, total int) *Pagination
- func (c *Client) PagesN(n int, count json.Number) *Pagination
- func (c *Client) R(referer string, args ...interface{}) *resty.Request
- func (c *Client) SetTransport(next http.RoundTripper) *Client
- type ClientOption
- type ClientOptionFunc
- type LoginForm
- type LoginParseState
- type Pagination
- type Request
- type RequestOptions
- type ResponseHandler
Constants ¶
View Source
const (
DefaultHost = "https://www.myminifactory.com/"
)
View Source
const (
DirectoryMode fs.FileMode = 0755
)
View Source
const (
MaxLoginAttempts = 2
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutoLogin ¶
type AutoLogin struct { Transport http.RoundTripper // contains filtered or unexported fields }
type Client ¶
type Client struct { *resty.Client Credentials mmf.Credentials TraceEnabled bool }
func New ¶
func New(cred mmf.Credentials) *Client
func NewWithClient ¶
func NewWithClient(cred mmf.Credentials, hc *http.Client) *Client
func NewWithOptions ¶
func NewWithOptions(options ...ClientOption) (*Client, error)
func NewWithTransport ¶
func NewWithTransport(cred mmf.Credentials, transport http.RoundTripper) *Client
func (*Client) Pages ¶
func (c *Client) Pages(n, total int) *Pagination
func (*Client) SetTransport ¶
func (c *Client) SetTransport(next http.RoundTripper) *Client
type ClientOption ¶
func WithCookieJar ¶
func WithCookieJar(jar http.CookieJar) ClientOption
func WithCredentials ¶
func WithCredentials(cred mmf.Credentials) ClientOption
func WithTransport ¶
func WithTransport(transport http.RoundTripper) ClientOption
type ClientOptionFunc ¶
func (ClientOptionFunc) Apply ¶
func (f ClientOptionFunc) Apply(c *Client) error
type LoginForm ¶
type LoginParseState ¶
type LoginParseState func(z *html.Tokenizer, form *LoginForm) (LoginParseState, error)
type Pagination ¶
func Pages ¶
func Pages(n, total int) *Pagination
type Request ¶
type Request struct { *resty.Request Client *Client Handler ResponseHandler Output *os.File }
type RequestOptions ¶
type RequestOptions struct { Accept string Referer string Path string Query url.Values Method string Result interface{} OutputDirectory string Handler ResponseHandler }
func (RequestOptions) Clone ¶
func (opt RequestOptions) Clone() RequestOptions
func (*RequestOptions) Setf ¶
func (opt *RequestOptions) Setf(k string, v string, args ...interface{})
type ResponseHandler ¶
Click to show internal directories.
Click to hide internal directories.