types

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToImageType

func ConvertToImageType(filetype string) string

ConvertToImageType converts file extension type to gql image type.

func ProjectHeaderString

func ProjectHeaderString() []string

ProjectHeaderString gives a row of string for the table header.

func ProjectsToTable

func ProjectsToTable(ps []Project, webDomain string, w io.Writer) *tablewriter.Table

ProjectsToTable transforms slice of projects into a table.

func UserHeaderString

func UserHeaderString() []string

UserHeaderString gives a row of string for the table header.

Types

type CloudPath

type CloudPath struct {
	Key     string
	DataURL string
}

CloudPath represents the gql 'CloudPath' type.

type Downloadable

type Downloadable struct {
	State string
	Name  string
	Size  int64
	Mtime time.Time
	Link  string
}

Downloadable represents the gql 'Downloadable' type.

type DownloadsConnection

type DownloadsConnection struct {
	TotalCount int
	Edges      []struct {
		Node Downloadable
	}
}

DownloadsConnection represents the gql 'DownloadsConnection' type.

type Endpoints

type Endpoints struct {
	API string
	Web string
}

Endpoints represents the gql Endpoints type.

type Error

type Error struct {
	Code    int
	Message string
}

Error represents some of the gql error types.

type Image

type Image struct {
	ID       string
	State    string
	Name     string
	Filename string
	Error    []string
}

Image represents the gql 'ProjectImage' type.

type ImportedModel

type ImportedModel struct {
	ID       string
	State    string
	Name     string
	Filename string
	Error    []string
}

ImportedModel represents the gql 'ImportedModel' type.

type MembershipInfo

type MembershipInfo struct {
	State             string               `json:"state"`
	PlanName          string               `json:"planName"`
	Period            int                  `json:"period"`
	StartDate         time.Time            `json:"startDate"`
	EndDate           time.Time            `json:"endDate"`
	MemberGPQuota     float64              `json:"memberGPQuota"`
	CoinPerGP         float64              `json:"coinPerGP"`
	AssetStorage      float64              `json:"assetStorage"`
	Visibility        []string             `json:"visibility"`
	Coupon            MembershipPlanCoupon `json:"coupon"`
	ModelPerProject   int                  `json:"modelPerProject"`
	CollaboratorQuota int                  `json:"collaboratorQuota"`
	ForceWatermark    bool                 `json:"forceWaterMark"`
}

MembershipInfo represents the gql MembershipInfo type.

type MembershipPlanCoupon

type MembershipPlanCoupon struct {
	Value      int `json:"value"`
	Repeat     int `json:"repeat"`
	ValidMonth int `json:"validMonth"`
}

MembershipPlanCoupon represents the gql MEMBERSHIP_PLAN_COUPON type.

func (MembershipPlanCoupon) String

func (c MembershipPlanCoupon) String() string

type MetaFile

type MetaFile struct {
	ID       string
	State    string
	Name     string
	Filename string
	Filesize float64
	Date     time.Time
	Checksum string
	Error    []string
}

MetaFile represents the gql 'ProjectMetaFile' type.

type Model

type Model struct {
	ID       string
	State    string
	Name     string
	Filename string
	Error    []string
}

Model represents the gql 'ImportedModel' type.

type PageInfo

type PageInfo struct {
	HasNextPage     bool
	HasPreviousPage bool
	StartCursor     string
	EndCursor       string
}

PageInfo represents the relay's page-info.

type Project

type Project struct {
	ID            string
	Name          string
	IsImported    bool
	ImportedState string
	ProjectType   string
	NumImage      int
	GigaPixel     float64
	TaskState     string
	Date          time.Time
	CloudPath     []CloudPath
	Downloads     DownloadsConnection
}

Project represents the gql project type.

func (Project) Cloud

func (p Project) Cloud() []string

Cloud returns the cloud keys of the project.

func (Project) RowString

func (p Project) RowString(webDomain string) []string

RowString gives a row of string for the table output.

func (Project) String

func (p Project) String() string

type ProjectImage

type ProjectImage struct {
	ID       string
	State    string
	URL      string
	Grounded bool
	Name     string
	Filename string
}

ProjectImage represents the gql ProjectImage type.

type STS

type STS struct {
	ID       string
	Secret   string
	Token    string
	Bucket   string
	Endpoint string
	Expire   string
}

STS represents the STS credentials returned from api server.

type Task

type Task struct {
	ID         string
	TaskType   string
	State      string
	StartDate  time.Time
	EndDate    time.Time
	TotalSteps int
	Step       int
	Queueing   int
}

Task represents the gql 'Task' type.

type User

type User struct {
	Email       string
	Name        string
	Username    string
	Balance     float64
	FreeGPQuota float64
	Country     string
	Stats       struct {
		Star      int
		Project   int
		Planet    int
		Follower  int // Number of fans following me
		Following int // Number of users I am following
	}
	MembershipState string // NA, ACTIVE, SUSPENDED, TRIAL, EXPIRED, STOPPED
	Membership      MembershipInfo
	ModelUsage      float64
	Developer       struct {
		Status string // NA, UNDER_REVIEW, TRIAL, ACTIVE, INACTIVE, EXPIRED
	}
	Joined time.Time
}

User represents the gql user type.

func (*User) NameOrEmail

func (u *User) NameOrEmail() string

NameOrEmail gives the email if username is not set.

func (*User) RowString

func (u *User) RowString() []string

RowString gives a row of string for the table output.

Jump to

Keyboard shortcuts

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