thingiverse

package module
v0.0.0-...-51a6946 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

README

Thingiverse

This is a WIP client for the Thingiverse REST API.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(username, password string) (*Client, error)

func (Client) Search

func (c Client) Search(ctx context.Context, opts *SearchOpts) ([]Thing, error)

type Creator

type Creator struct {
	AcceptsTips      bool   `json:"accepts_tips"`
	CountOfDesigns   int    `json:"count_of_designs"`
	CountOfFollowers int    `json:"count_of_followers"`
	CountOfFollowing int    `json:"count_of_following"`
	Cover            string `json:"cover"`
	FirstName        string `json:"first_name"`
	ID               int    `json:"id"`
	IsFollowing      bool   `json:"is_following"`
	LastName         string `json:"last_name"`
	Location         string `json:"location"`
	Name             string `json:"name"`
	PublicURL        string `json:"public_url"`
	Thumbnail        string `json:"thumbnail"`
	URL              string `json:"url"`
}

type PageOpt

type PageOpt struct {
	Page    int
	PerPage int
	Sort    string
}

func (PageOpt) Query

func (po PageOpt) Query() string

type SearchOpts

type SearchOpts struct {
	PageOpt
	PostedAfter string
	Type        string
}

func (SearchOpts) Query

func (so SearchOpts) Query() string

type Tag

type Tag struct {
	AbsoluteURL string `json:"absolute_url"`
	Count       int    `json:"count"`
	Name        string `json:"name"`
	Tag         string `json:"tag"`
	ThingsURL   string `json:"things_url"`
	URL         string `json:"url"`
}

type Thing

type Thing struct {
	CommentCount int         `json:"comment_count"`
	CreatedAt    string      `json:"created_at"`
	Creator      Creator     `json:"creator"`
	ID           int         `json:"id"`
	IsNsfw       bool        `json:"is_nsfw"`
	IsPrivate    interface{} `json:"is_private"`
	IsPublished  interface{} `json:"is_published"`
	IsPurchased  interface{} `json:"is_purchased"`
	LikeCount    int         `json:"like_count"`
	Name         string      `json:"name"`
	PreviewImage string      `json:"preview_image"`
	PublicURL    string      `json:"public_url"`
	Tags         []Tag       `json:"tags"`
	Thumbnail    string      `json:"thumbnail"`
	URL          string      `json:"url"`
}

type ThingRes

type ThingRes struct {
	Hits  []Thing `json:"hits"`
	Total int     `json:"total"`
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL