Documentation ¶
Index ¶
- Variables
- type Attribute
- type AttributeType
- type AuthResponse
- type Client
- func (c *Client) Auth(ctx context.Context) error
- func (c *Client) Get(ctx context.Context, uri string, respData interface{}) (*http.Response, error)
- func (c *Client) NewRequest(method string, urlStr string, body io.Reader) (*http.Request, error)
- func (c *Client) Post(ctx context.Context, uri string, form url.Values, respData interface{}) (*http.Response, error)
- func (c *Client) PostJSON(ctx context.Context, urlStr string, data interface{}, respData interface{}) (*http.Response, error)
- func (c *Client) PostXML(ctx context.Context, urlStr string, data interface{}, respData interface{}) (*http.Response, error)
- func (c *Client) User(ctx context.Context, userID string) (*Profile, error)
- func (c *Client) Users(ctx context.Context, params url.Values) (*UserList, error)
- type ErrorResponse
- type Profile
- type UserList
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoContent is returned when an HTTP resposne has a 2XX response code but a 0 ContentLength ErrNoContent = errors.New("HTTP response has no content length") )
Functions ¶
This section is empty.
Types ¶
type Attribute ¶
type Attribute struct { UserID string `json:"userId" xml:"userId"` AttID string `json:"attId" xml:"attId"` AttTypeID AttributeType `json:"attTypeId" xml:"attTypeId"` AttName string `json:"attName" xml:"attName"` AttData string `json:"attData" xml:"attData"` LastModify time.Time `json:"lastModifiy" xml:"lastModify"` }
type AttributeType ¶
type AttributeType int
func (AttributeType) String ¶
func (a AttributeType) String() string
type AuthResponse ¶
type AuthResponse struct { UserID string `json:"userId"` GroupID string `json:"groupId"` OrgID string `json:"orgId"` ContactName string `json:"contactName"` UserName string `json:"userName"` Active bool `json:"active,string"` Validated bool `json:"validated,string"` Deleted bool `json:"deleted,string"` FormStatus string `json:"formStats"` LastModify string `json:"lastModify"` NoMassEmail bool `json:"noMassEmail,string"` PrefBBContact string `json:"prefBBContact"` PrefBBImage string `json:"prefBBImage"` Token string `json:"token"` Password string `json:"password"` }
AuthResponse is a MemberClicks classic auth response
type Client ¶
type Client struct { OrganizationID string HttpClient *http.Client sync.Mutex // contains filtered or unexported fields }
Classic handles sending/receiving data to/from the MemberClicks Classic
func (*Client) Get ¶
Get sends a HTTP GET request to the given uri and returns the XML encoded respone in respData
func (*Client) NewRequest ¶
NewRequest matches the http.NewRequest signature but sets required headers.
func (*Client) Post ¶
func (c *Client) Post(ctx context.Context, uri string, form url.Values, respData interface{}) (*http.Response, error)
Post sends a HTTP Post request to the given url and returns the result decoded into respDatc.
func (*Client) PostJSON ¶
func (c *Client) PostJSON(ctx context.Context, urlStr string, data interface{}, respData interface{}) (*http.Response, error)
PostJSON sends a JSON POST request to the urlStr with a body of data and decodes result into respData
type ErrorResponse ¶
type ErrorResponse struct { Timestamp int64 `json:"timestamp"` Status int `json:"status"` Error string `json:"error"` Message string `json:"message"` MessageDetails []string `json:"messageDetails"` // not sure what format this is Path string `json:"path"` Parameters map[string]string // not sure what format this is, probably string }
ErrorResponse is a MemberClicks classic error response
func (*ErrorResponse) Time ¶
func (e *ErrorResponse) Time() time.Time
Time returns the time of the error response
type Profile ¶
type Profile struct { UserID string `json:"userId" xml:"userId"` GroupID string `json:"groupId" xml:"groupId"` ContactName string `json:"contactName" xml:"contactName"` Active bool `json:"active,string" xml:"active"` Validated bool `json:"validated,string" xml:"validated"` Deleted bool `json:"deleted,string" xml:"deleted"` Attributes []Attribute `json:"attribute" xml:"attribute"` }
Click to show internal directories.
Click to hide internal directories.