trac

package
v0.0.0-...-3e58e7c Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2017 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TOKEN_FORM_RE = regexp.MustCompile(`<input\s+type="hidden"\s+name="__FORM_TOKEN"\s+value="([a-z0-9]+)"\s+/>`)

Functions

This section is empty.

Types

type AuthType

type AuthType uint
const (
	AuthBasic AuthType = iota
	AuthForm
)

func ParseAuthType

func ParseAuthType(s string) (AuthType, error)

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(url string, authType AuthType, debug bool) (*Client, error)

func NewWithHttpClient

func NewWithHttpClient(url string, authType AuthType, debug bool, client HttpClient) (*Client, error)

func (*Client) Authenticate

func (c *Client) Authenticate(username, password string) error

func (*Client) GetTicket

func (c *Client) GetTicket(id string) (Ticket, error)

func (*Client) SetInsecure

func (c *Client) SetInsecure(insecure bool)

type HTTPTransport

type HTTPTransport struct {
	http.Transport
	Log bool
}

func (*HTTPTransport) RoundTrip

func (t *HTTPTransport) RoundTrip(req *http.Request) (*http.Response, error)

type HttpClient

type HttpClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type Ticket

type Ticket map[string]string

Ticket in Trac can come in any shape, so our representation is just a map of strings. There will always be a "_url" member in the hash being the URL to the ticket, the other fields depend of the Trac configuration.

Jump to

Keyboard shortcuts

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