Package webfonts
Overview ▹
Index ▹
type Service ¶
type Service struct { BasePath string // API endpoint base URL UserAgent string // optional additional User-Agent fragment Webfonts *WebfontsService // contains filtered or unexported fields }
func New ¶
func New(client *http.Client) (*Service, error)
type Webfont ¶
type Webfont struct { // Category: The category of the font. Category string `json:"category,omitempty"` // Family: The name of the font. Family string `json:"family,omitempty"` // Files: The font files (with all supported scripts) for each one of // the available variants, as a key : value map. Files map[string]string `json:"files,omitempty"` // Kind: This kind represents a webfont object in the webfonts service. Kind string `json:"kind,omitempty"` // LastModified: The date (format "yyyy-MM-dd") the font was modified // for the last time. LastModified string `json:"lastModified,omitempty"` // Subsets: The scripts supported by the font. Subsets []string `json:"subsets,omitempty"` // Variants: The available variants for the font. Variants []string `json:"variants,omitempty"` // Version: The font version. Version string `json:"version,omitempty"` // ForceSendFields is a list of field names (e.g. "Category") to // unconditionally include in API requests. By default, fields with // empty values are omitted from API requests. However, any non-pointer, // non-interface field appearing in ForceSendFields will be sent to the // server regardless of whether the field is empty or not. This may be // used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Category") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` }
func (*Webfont) MarshalJSON ¶
func (s *Webfont) MarshalJSON() ([]byte, error)
type WebfontList ¶
type WebfontList struct { // Items: The list of fonts currently served by the Google Fonts API. Items []*Webfont `json:"items,omitempty"` // Kind: This kind represents a list of webfont objects in the webfonts // service. Kind string `json:"kind,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "Items") to // unconditionally include in API requests. By default, fields with // empty values are omitted from API requests. However, any non-pointer, // non-interface field appearing in ForceSendFields will be sent to the // server regardless of whether the field is empty or not. This may be // used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Items") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` }
func (*WebfontList) MarshalJSON ¶
func (s *WebfontList) MarshalJSON() ([]byte, error)
type WebfontsListCall ¶
type WebfontsListCall struct {
// contains filtered or unexported fields
}
func (*WebfontsListCall) Context ¶
func (c *WebfontsListCall) Context(ctx context.Context) *WebfontsListCall
Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.
func (*WebfontsListCall) Do ¶
func (c *WebfontsListCall) Do(opts ...googleapi.CallOption) (*WebfontList, error)
Do executes the "webfonts.webfonts.list" call. Exactly one of *WebfontList or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *WebfontList.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.
func (*WebfontsListCall) Fields ¶
func (c *WebfontsListCall) Fields(s ...googleapi.Field) *WebfontsListCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
func (*WebfontsListCall) Header ¶
func (c *WebfontsListCall) Header() http.Header
Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.
func (*WebfontsListCall) IfNoneMatch ¶
func (c *WebfontsListCall) IfNoneMatch(entityTag string) *WebfontsListCall
IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.
func (*WebfontsListCall) Sort ¶
func (c *WebfontsListCall) Sort(sort string) *WebfontsListCall
Sort sets the optional parameter "sort": Enables sorting of the list
Possible values:
"alpha" - Sort alphabetically "date" - Sort by date added "popularity" - Sort by popularity "style" - Sort by number of styles "trending" - Sort by trending
type WebfontsService ¶
type WebfontsService struct {
// contains filtered or unexported fields
}
func NewWebfontsService ¶
func NewWebfontsService(s *Service) *WebfontsService
func (*WebfontsService) List ¶
func (r *WebfontsService) List() *WebfontsListCall
List: Retrieves the list of fonts currently served by the Google Fonts Developer API