Documentation ¶
Index ¶
- Constants
- Variables
- type ApiClient
- type GetSitesOptions
- type Response
- type Site
- type SiteOptions
- type SitesService
- func (p *SitesService) CreateSite(opt *SiteOptions) (*Site, *Response, error)
- func (p *SitesService) DeleteSite(idSite string) (bool, *Response, error)
- func (p *SitesService) GetSiteByID(idSite string) (*Site, *Response, error)
- func (p *SitesService) GetSites(opt *GetSitesOptions) (*[]Site, *Response, error)
- func (p *SitesService) UpdateSite(opt *SiteOptions) (*Site, *Response, error)
- type StandardReqOpt
Constants ¶
View Source
const ( GetSiteFromID = "SitesManager.getSiteFromId" AddSite = "SitesManager.addSite" UpdateSite = "SitesManager.updateSite" DeleteSite = "SitesManager.deleteSite" GetPatternMatchSites = "SitesManager.getPatternMatchSites" )
View Source
const (
API = "API"
)
View Source
const (
LibraryVersion = "0.0.1"
)
Variables ¶
View Source
var ( ErrNotFound = errors.New("entity not found") ErrApiUrlCannotBeEmpty = errors.New("api_url cannot be empty") ErrTokenAuthCannotBeEmpty = errors.New("auth_token cannot be empty") )
Exported Errors
Functions ¶
This section is empty.
Types ¶
type ApiClient ¶ added in v0.0.4
type ApiClient struct { UserAgent string Sites *SitesService // contains filtered or unexported fields }
func (*ApiClient) SetAuthToken ¶ added in v0.0.4
type GetSitesOptions ¶
type GetSitesOptions struct {
Pattern *string `url:"pattern"`
}
Site represents a Site resource
type Response ¶
Response is a Matomo API response. This wraps the standard http.Response returned from Matomo API and provides convenient access to things like errors
type Site ¶
type Site struct { ID string `json:"idSite,omitempty"` Name string `json:"siteName"` Value int `json:"value,omitempty"` }
Site represents a Site resource
type SiteOptions ¶
Site represents a Site resource
type SitesService ¶
type SitesService struct {
// contains filtered or unexported fields
}
func (*SitesService) CreateSite ¶
func (p *SitesService) CreateSite(opt *SiteOptions) (*Site, *Response, error)
CreateSite creates a Site
func (*SitesService) DeleteSite ¶
func (p *SitesService) DeleteSite(idSite string) (bool, *Response, error)
DeleteSite deletes the given Site
func (*SitesService) GetSiteByID ¶
func (p *SitesService) GetSiteByID(idSite string) (*Site, *Response, error)
GetSiteByID retrieves a site by ID
func (*SitesService) GetSites ¶
func (p *SitesService) GetSites(opt *GetSitesOptions) (*[]Site, *Response, error)
GetSites retrieves sites by pattern
func (*SitesService) UpdateSite ¶
func (p *SitesService) UpdateSite(opt *SiteOptions) (*Site, *Response, error)
CreateSite updates a Site
Click to show internal directories.
Click to hide internal directories.