Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuditLogEntry ¶
type AuditLogEntry struct { Id int `json:"id"` Ip string `json:"ip"` Action string `json:"action"` Details string `json:"details"` Created time.Time `json:"created"` }
An audit log entry
type AuditLogEntryPager ¶
type AuditLogEntryPager struct { Next *int `json:"next,string"` Total int `json:"total"` Results []*AuditLogEntry `json:"results"` ResultsPerPage int `json:"results_per_page"` // contains filtered or unexported fields }
A pager for enumerating audit log entries
func (*AuditLogEntryPager) NextPage ¶
func (pager *AuditLogEntryPager) NextPage() error
Fetches the next page of results.
func (*AuditLogEntryPager) Url ¶
func (p *AuditLogEntryPager) Url(start *int) string
Gets the URL for fetching a page of results, startin from the given ID, or nil to fetch the first page.
type MetaClient ¶
type MetaClient struct {
// contains filtered or unexported fields
}
An API client for meta.sr.ht.
func NewMetaClient ¶
func NewMetaClient(srhtClient *srht.SrhtClient) *MetaClient
Creates a new meta.sr.ht API client with the default upstream (https://meta.sr.ht).
func (*MetaClient) GetAuditLogs ¶
func (client *MetaClient) GetAuditLogs( start *int) (*AuditLogEntryPager, error)
Fetches a page of audit log entries starting from the given ID, or nil to start from the first page.
func (*MetaClient) GetProfile ¶
func (client *MetaClient) GetProfile() (*MetaProfile, error)
Gets the logged in user's profile information.
func (*MetaClient) Origin ¶
func (client *MetaClient) Origin() string
Returns the upstream for this meta.sr.ht API client.
func (*MetaClient) PutProfile ¶
func (client *MetaClient) PutProfile() *PutProfile
Initialize a request to update the user's profile.
func (*MetaClient) WithOrigin ¶
func (client *MetaClient) WithOrigin(origin string) *MetaClient
Sets the upstream for this meta.sr.ht API client to a particular SourceHut instance.
type MetaProfile ¶
type MetaProfile struct { srht.User UsePGPKey *int `json:"use_pgp_key"` }
A profile on meta.sr.ht. Based on srht.User, with additional fields provided by meta.sr.ht.
type PutProfile ¶
type PutProfile struct {
// contains filtered or unexported fields
}
A request to update a user's profile. Create this request with MetaClient.PutProfile(), then call the functions provided to populate it with the changes you want to make. Call PutProfile.Put() to perform the HTTP request, committing the changes.
func (*PutProfile) Bio ¶
func (profile *PutProfile) Bio(bio string) *PutProfile
Sets the profile "bio" field.
func (*PutProfile) Email ¶
func (profile *PutProfile) Email(email string) *PutProfile
Sets the profile "email" field.
func (*PutProfile) Location ¶
func (profile *PutProfile) Location(location string) *PutProfile
Sets the profile "location" field.
func (*PutProfile) Put ¶
func (profile *PutProfile) Put() (*MetaProfile, error)
Sends the API request, committing the requested profile update.
func (*PutProfile) Url ¶
func (profile *PutProfile) Url(url string) *PutProfile
Sets the profile "url" field.