boosty
/
blog.go
75 строк · 2.5 Кб
1package boosty2
3import (4"fmt"5"net/http"6"net/url"7)
8
9type Blog struct {10Owner struct {11ID int `json:"id"`12HasAvatar bool `json:"hasAvatar"`13Name string `json:"name"`14AvatarURL string `json:"avatarUrl"`15} `json:"owner"`16Title string `json:"title"`17IsReadOnly bool `json:"isReadOnly"`18Flags struct {19ShowPostDonations bool `json:"showPostDonations"`20AllowGoogleIndex bool `json:"allowGoogleIndex"`21HasTargets bool `json:"hasTargets"`22AcceptDonationMessages bool `json:"acceptDonationMessages"`23AllowIndex bool `json:"allowIndex"`24IsRssFeedEnabled bool `json:"isRssFeedEnabled"`25HasSubscriptionLevels bool `json:"hasSubscriptionLevels"`26} `json:"flags"`27SignedQuery string `json:"signedQuery"`28IsBlackListedByUser bool `json:"isBlackListedByUser"`29IsSubscribed bool `json:"isSubscribed"`30Subscription interface{} `json:"subscription"`31IsTotalBaned bool `json:"isTotalBaned"`32AccessRights struct {33CanSetPayout bool `json:"canSetPayout"`34CanCreateComments bool `json:"canCreateComments"`35CanEdit bool `json:"canEdit"`36CanView bool `json:"canView"`37CanDeleteComments bool `json:"canDeleteComments"`38CanCreate bool `json:"canCreate"`39} `json:"accessRights"`40Count struct {41Subscribers int `json:"subscribers"`42Posts int `json:"posts"`43} `json:"count"`44BlogURL string `json:"blogUrl"`45IsOwner bool `json:"isOwner"`46PublicWebSocketChannel string `json:"publicWebSocketChannel"`47SubscriptionKind string `json:"subscriptionKind"`48IsBlackListed bool `json:"isBlackListed"`49AllowedPromoTypes []string `json:"allowedPromoTypes"`50Description []struct {51Type string `json:"type"`52Content string `json:"content"`53Explicit bool `json:"explicit,omitempty"`54URL string `json:"url,omitempty"`55Modificator string `json:"modificator,omitempty"`56} `json:"description"`57SocialLinks []struct {58URL string `json:"url"`59Type string `json:"type"`60} `json:"socialLinks"`61HasAdultContent bool `json:"hasAdultContent"`62CoverURL string `json:"coverUrl"`63}
64
65func (b *Boosty) Blog() (*Blog, error) {66u := fmt.Sprintf("/v1/blog/%s", b.blog)67m := Method[Blog]{68request: b.request,69method: http.MethodGet,70url: u,71values: url.Values{},72}73
74return m.Call(Blog{})75}
76