json

package
v0.0.0-...-239b6c0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PledgesLibraryRequest = client.RequestOptions{
	Accept:  "application/json",
	Referer: "/library/?v=campaigns",
	Path:    "/data-library/campaigns",
	Method:  "GET",
	Result:  Objects{},
}

Pledges

View Source
var PurchasesLibraryRequest = client.RequestOptions{
	Accept:  "application/json",
	Referer: "/library/?v=purchases",
	Path:    "/data-library/purchases",
	Method:  "GET",
	Result:  Objects{},
}

Purchases

View Source
var SharedLibraryRequest = client.RequestOptions{
	Accept:  "application/json",
	Referer: "/library/?v=shared",
	Path:    "/data-library/shared",
	Method:  "GET",
	Result:  Users{},
}

Shared

View Source
var TribesLibraryRequest = client.RequestOptions{
	Accept:  "application/json",
	Referer: "/library/?v=my-tribes",
	Path:    "/data-library/tribes",
	Method:  "GET",
	Result:  Tribes{},
}

Tribes

Functions

func GroupsPages

func GroupsPages(d *Groups) *client.Pagination

works out if a Groups response needs more pages

func NewSharedGroupFromRequest

func NewSharedGroupFromRequest(req *http.Request) client.RequestOptions

func NewSharedGroupRequest

func NewSharedGroupRequest(g *types.Group) client.RequestOptions

/data-library/group/{id}

func NewTribeSharedGroupFromRequest

func NewTribeSharedGroupFromRequest(req *http.Request) client.RequestOptions

func NewTribeSharedGroupRequest

func NewTribeSharedGroupRequest(g *types.Group) client.RequestOptions

func NewUserSharedGroupFromRequest

func NewUserSharedGroupFromRequest(req *http.Request) client.RequestOptions

func NewUserSharedGroupRequest

func NewUserSharedGroupRequest(g *types.Group) client.RequestOptions

func NewUserSharedLibraryFromRequest

func NewUserSharedLibraryFromRequest(req *http.Request) client.RequestOptions

func NewUserSharedLibraryRequest

func NewUserSharedLibraryRequest(u *types.User) client.RequestOptions

/data-library/shared/{username}

func ObjectsPages

func ObjectsPages(d *Objects) *client.Pagination

works out if a Objects response needs more pages

func TribesPages

func TribesPages(d *Tribes) *client.Pagination

works out if a Tribes response needs more pages

func UserSharedLibraryPages

func UserSharedLibraryPages(p *UserSharedLibrary) *client.Pagination

func UsersPages

func UsersPages(d *Users) *client.Pagination

works out if a Users response needs more pages

func Write

func Write(data interface{}, indent string, out io.Writer) error

Types

type API

type API struct {
	URL    string `json:"url"`
	Method string `json:"httpMethod"`
}

type Archive

type Archive struct {
	Id          int    `json:"id"`
	Filename    string `json:"path"`
	Size        int    `json:"size"`
	DownloadURL string `json:"download_url"`
}

type Collection

type Collection struct{}

type File

type File struct {
	Id           int       `json:"id"`
	Filename     string    `json:"filename"`
	Description  string    `json:"description"`
	Status       int       `json:"status"`
	StatusName   string    `json:"status_name"`
	Size         int       `json:"size"`
	PatchURL     string    `json:"patch_url"`
	ThumbnailURL string    `json:"thumbnail_url"`
	DownloadURL  string    `json:"download_url"`
	CreatedAt    time.Time `json:"created_at"`
	ViewerURL    string    `json:"viewer_url"`
	Render360    []string  `json:"render360_urls"`
}

type Files

type Files struct {
	Count int    `json:"total_count,omitempty"`
	Items []File `json:"items,omitempty"`
}

type Group

type Group struct {
	Id           types.Id       `json:"id"`
	Name         string         `json:"name"`
	API          map[string]API `json:"apis,omitempty"`
	TotalObjects int            `json:"total_count_objects,omitempty"`
	Children     []Group        `json:"childrens,omitempty"`
	Objects
}

func (*Group) Apply

func (w *Group) Apply(d *types.Library, u *types.User, parent *types.Group) (*types.Group, error)

func (*Group) Export

func (w *Group) Export(recursive bool) *types.Group

type Groups

type Groups struct {
	Count int     `json:"total_count"`
	Items []Group `json:"items"`
}

func (*Groups) Apply

func (w *Groups) Apply(d *types.Library, u *types.User) error

type Image

type Image struct {
	Id                 int       `json:"id"`
	UploadId           string    `json:"upload_id"`
	Primary            bool      `json:"is_primary,omitempty"`
	PrintImageSelected bool      `json:"is_print_image_selected,omitempty"`
	Original           ImageFile `json:"original,omitempty"`
	Tiny               ImageFile `json:"tiny,omitempty"`
	Thumbnail          ImageFile `json:"thumbnail,omitempty"`
	Standard           ImageFile `json:"standard,omitempty"`
	Large              ImageFile `json:"large,omitempty"`
}

type ImageFile

type ImageFile struct {
	URL    string `json:"url"`
	Width  *int   `json:"width"`
	Height *int   `json:"height"`
}

type Images

type Images struct {
	Count int     `json:"total_count,omitempty"`
	Items []Image `json:"items,omitempty"`
}

type Object

type Object struct {
	Id                 int            `json:"id,omitempty"`
	Name               string         `json:"name,omitempty"`
	Description        string         `json:"description,omitempty"`
	Type               string         `json:"type,omitempty"`
	ObjType            string         `json:"document_name_s,omitempty"`
	Private            bool           `json:"is_private,omitempty"`
	Visits             int            `json:"visits,omitempty"`
	URL                string         `json:"url,omitempty"`
	ShowURL            string         `json:"show_url,omitempty"`
	AbsoluteURL        string         `json:"absolute_url,omitempty"`
	Image              string         `json:"obj_img,omitempty"`
	Images             Images         `json:"images,omitempty"`
	Wide               bool           `json:"wide,omitempty"`
	Purchased          bool           `json:"is_purchased,omitempty"`
	Price              ObjectPrice    `json:"price,omitempty"`
	FileMode           int            `json:"file_mode,omitempty"`
	Permissions        int            `json:"permissions,omitempty"`
	DownloadURL        string         `json:"download_url,omitempty"`
	ArchiveDownloadURL string         `json:"archive_download_url,omitempty"`
	Archives           []Archive      `json:"archives,omitempty"`
	Files              Files          `json:"files,omitempty"`
	Pledges            Groups         `json:"pledges,omitempty"`
	User               string         `json:"username,omitempty"`
	UserName           string         `json:"user_name,omitempty"`
	UserURL            string         `json:"user_url,omitempty"`
	UserImage          string         `json:"user_img,omitempty"`
	UserCollections    []Collection   `json:"user_collections,omitempty"`
	UserCredits        *json.Number   `json:"user_credits,omitempty"`
	API                map[string]API `json:"apis,omitempty"`
}

func (*Object) Apply

func (obj *Object) Apply(d *types.Library, u *types.User, g *types.Group) error

type ObjectItems

type ObjectItems []Object

func (*ObjectItems) UnmarshalJSON

func (w *ObjectItems) UnmarshalJSON(data []byte) error

type ObjectPrice

type ObjectPrice struct {
	Currency string      `json:"currency"`
	Symbol   string      `json:"symbol"`
	Value    json.Number `json:"value"`
}

type Objects

type Objects struct {
	Count json.Number `json:"total_count,omitempty"`
	Items ObjectItems `json:"items,omitempty"`
}

func PledgesLibraryResult

func PledgesLibraryResult(resp *resty.Response) *Objects

PledgesLibraryResult() pulls a *Objects out of a resty.Response

func PurchasesLibraryResult

func PurchasesLibraryResult(resp *resty.Response) *Objects

PurchasesLibraryResult() pulls a *Objects out of a resty.Response

func TribeSharedGroupResult

func TribeSharedGroupResult(resp *resty.Response) *Objects

TribeSharedGroupResult() pulls a *Objects out of a resty.Response

func UserSharedGroupResult

func UserSharedGroupResult(resp *resty.Response) *Objects

UserSharedGroupResult() pulls a *Objects out of a resty.Response

func (*Objects) Apply

func (w *Objects) Apply(d *types.Library, u *types.User, g *types.Group) error

type Tribe

type Tribe struct {
	Id         int         `json:"id"`
	Name       string      `json:"name"`
	UserAvatar string      `json:"user_avatar"`
	URL        string      `json:"url"`
	Groups     TribeGroups `json:"groups,omitempty"`
}

func (*Tribe) Apply

func (w *Tribe) Apply(d *types.Library) (*types.Tribe, error)

type TribeGroup

type TribeGroup struct {
	Id           types.Id `json:"id"`
	Name         string   `json:"name"`
	TotalObjects int      `json:"total_count_objects,omitempty"`
	Date         string   `json:"date,omitempty"`
}

type TribeGroups

type TribeGroups struct {
	Count int          `json:"total_count,omitempty"`
	Items []TribeGroup `json:"items,omitempty"`
}

func (*TribeGroups) Apply

func (w *TribeGroups) Apply(tribe *types.Tribe) error

type Tribes

type Tribes struct {
	Count int     `json:"total_count,omitempty"`
	Items []Tribe `json:"items,omitempty"`
}

func TribesLibraryResult

func TribesLibraryResult(resp *resty.Response) *Tribes

TribesLibraryResult() pulls a *Tribes out of a resty.Response

type User

type User struct {
	Id       string         `json:"id"`
	Username string         `json:"username"`
	Name     string         `json:"name"`
	Avatar   string         `json:"avatar_url"`
	API      map[string]API `json:"apis,omitempty"`
	Groups   Groups         `json:"groups,omitempty"`
}

func (*User) Apply

func (w *User) Apply(d *types.Library) (*types.User, error)

func (*User) Export

func (w *User) Export(groups bool) *types.User

func (*User) ExportGroups

func (w *User) ExportGroups(recursive bool) []*types.Group

type UserSharedLibrary

type UserSharedLibrary struct {
	Objects Objects `json:"objects,omitempty"`
	Groups  Groups  `json:"groups,omitempty"`
}

func UserSharedLibraryResult

func UserSharedLibraryResult(resp *resty.Response) *UserSharedLibrary

UserSharedLibraryResult() pulls a *UserSharedLibrary out of a resty.Response

func (*UserSharedLibrary) Apply

func (p *UserSharedLibrary) Apply(d *types.Library, u *types.User) error

type Users

type Users struct {
	Count json.Number `json:"total_count"`
	Items []User      `json:"items"`
}

func SharedLibraryResult

func SharedLibraryResult(resp *resty.Response) *Users

SharedLibraryResult() pulls a *Users out of a resty.Response

func (*Users) Apply

func (w *Users) Apply(d *types.Library) error

Jump to

Keyboard shortcuts

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