pinmonl

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: MIT Imports: 12 Imported by: 0

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(addr string, client *http.Client) *Client

func (*Client) Alive

func (c *Client) Alive() (*Token, error)

func (*Client) Info

func (c *Client) Info() (*ServerInfo, error)

func (*Client) Login

func (c *Client) Login(user *User) (*Token, error)

func (*Client) MachineSignup

func (c *Client) MachineSignup() (*Token, error)

func (*Client) PinlClear

func (c *Client) PinlClear() error

func (*Client) PinlCreate

func (c *Client) PinlCreate(in *Pinl) (*Pinl, error)

func (*Client) PinlDelete

func (c *Client) PinlDelete(pinlID string) error

func (*Client) PinlList

func (c *Client) PinlList(opts *PinlListOpts) ([]*Pinl, error)

func (*Client) PkgList

func (c *Client) PkgList(opts *PkgListOpts) (*MonpkgListResponse, error)

func (*Client) SetClient

func (c *Client) SetClient(client *http.Client)

func (*Client) ShareDelete

func (c *Client) ShareDelete(slug string) error

func (*Client) SharePrepare

func (c *Client) SharePrepare(slug string, in *Share) (*Share, error)

func (*Client) SharePublish

func (c *Client) SharePublish(slug string) (*Share, error)

func (*Client) SharepinCreate

func (c *Client) SharepinCreate(slug string, in *Sharepin) (*Sharepin, error)

func (*Client) SharetagCreate

func (c *Client) SharetagCreate(slug string, in *Sharetag) (*Sharetag, error)

func (*Client) Sharing

func (c *Client) Sharing(user, slug string) (*Share, error)

func (*Client) SharingPinlList

func (c *Client) SharingPinlList(user, slug string, opts *PinlListOpts) ([]*Pinl, error)

func (*Client) SharingTagList

func (c *Client) SharingTagList(user, slug string, opts *TagListOpts) ([]*Tag, error)

func (*Client) Signup

func (c *Client) Signup(user *User) (*Token, error)

func (*Client) StatList

func (c *Client) StatList(opts *StatListOpts) (*StatListResponse, error)

type ListOpts

type ListOpts struct {
	Page int64
	Size int64
}

func (ListOpts) AppendTo

func (l ListOpts) AppendTo(val url.Values)

type Monpkg

type Monpkg struct {
	ID     string     `json:"id"`
	MonlID string     `json:"monlId"`
	PkgID  string     `json:"pkgId"`
	Kind   MonpkgKind `json:"kind"`
	Pkg    *Pkg       `json:"pkg"`
}

type MonpkgKind

type MonpkgKind int

type MonpkgListResponse

type MonpkgListResponse struct {
	TotalCount int64     `json:"totalCount"`
	Page       int64     `json:"page"`
	PageSize   int64     `json:"pageSize"`
	Data       []*Monpkg `json:"data"`
}

type Pinl

type Pinl struct {
	ID          string     `json:"id"`
	UserID      string     `json:"userId"`
	MonlID      string     `json:"monlId"`
	URL         string     `json:"url"`
	Title       string     `json:"title"`
	Description string     `json:"description"`
	ImageID     string     `json:"imageId"`
	Status      Status     `json:"status"`
	CreatedAt   field.Time `json:"createdAt"`
	UpdatedAt   field.Time `json:"updatedAt"`

	TagNames *[]string `json:"tagNames,omitempty"`
}

type PinlListOpts

type PinlListOpts struct {
	ListOpts
	Query string
	Tags  []string
}

func (PinlListOpts) Encode

func (p PinlListOpts) Encode() string

type Pkg

type Pkg struct {
	ID            string     `json:"id"`
	URL           string     `json:"url"`
	Provider      string     `json:"provider"`
	ProviderHost  string     `json:"providerHost"`
	ProviderURI   string     `json:"providerUri"`
	ProviderProto string     `json:"providerProto"`
	Title         string     `json:"title"`
	Description   string     `json:"description"`
	ImageID       string     `json:"imageId"`
	CustomUri     string     `json:"customUri"`
	CreatedAt     field.Time `json:"createdAt"`
	UpdatedAt     field.Time `json:"updatedAt"`
}

type PkgListOpts

type PkgListOpts struct {
	ListOpts
	URL string
}

func (PkgListOpts) Encode

func (p PkgListOpts) Encode() string

type ServerInfo

type ServerInfo struct {
	Version string `json:"version"`
}

type Share

type Share struct {
	ID          string     `json:"id"`
	UserID      string     `json:"userId"`
	Slug        string     `json:"slug"`
	Name        string     `json:"name"`
	Description string     `json:"description"`
	ImageID     string     `json:"imageId"`
	Status      Status     `json:"status"`
	CreatedAt   field.Time `json:"createdAt"`
	UpdatedAt   field.Time `json:"updatedAt"`

	User *User `json:"user,omitempty"`
}

type Sharepin

type Sharepin struct {
	ID      string `json:"id"`
	ShareID string `json:"shareId"`
	PinlID  string `json:"pinlId"`
	Status  Status `json:"status"`

	Pinl *Pinl `json:"pinl"`
}

type Sharetag

type Sharetag struct {
	ID          string       `json:"id"`
	ShareID     string       `json:"shareId"`
	TagID       string       `json:"tagId"`
	Kind        SharetagKind `json:"kind"`
	ParentID    string       `json:"parentId"`
	Level       int          `json:"level"`
	Status      Status       `json:"status"`
	HasChildren bool         `json:"hasChildren"`

	Tag *Tag `json:"tag"`
}

type SharetagKind

type SharetagKind int

type Stat

type Stat struct {
	ID          string        `json:"id"`
	PkgID       string        `json:"pkgId"`
	ParentID    string        `json:"parentId"`
	RecordedAt  field.Time    `json:"recordedAt"`
	Kind        StatKind      `json:"kind"`
	Name        string        `json:"name"`
	Value       string        `json:"value"`
	ValueType   StatValueType `json:"valueType"`
	Checksum    string        `json:"checksum"`
	Weight      int           `json:"weight"`
	IsLatest    bool          `json:"isLatest"`
	HasChildren bool          `json:"hasChildren"`

	Substats *[]*Stat `json:"substats,omitempty"`
}

type StatKind

type StatKind string

type StatListOpts

type StatListOpts struct {
	ListOpts
	Kinds   []string
	Latest  field.NullBool
	Parents []string
	Pkgs    []string
}

func (StatListOpts) Encode

func (s StatListOpts) Encode() string

type StatListResponse

type StatListResponse struct {
	TotalCount int64   `json:"totalCount"`
	Page       int64   `json:"page"`
	PageSize   int64   `json:"pageSize"`
	Data       []*Stat `json:"data"`
}

type StatValueType

type StatValueType int

type Status

type Status int

type Tag

type Tag struct {
	ID          string     `json:"id"`
	Name        string     `json:"name"`
	UserID      string     `json:"userId"`
	ParentID    string     `json:"parentId"`
	Level       int        `json:"level"`
	Color       string     `json:"color"`
	BgColor     string     `json:"bgColor"`
	HasChildren bool       `json:"hasChildren"`
	CreatedAt   field.Time `json:"createdAt"`
	UpdatedAt   field.Time `json:"updatedAt"`
}

type TagListOpts

type TagListOpts struct {
	ListOpts
	Query string
}

func (TagListOpts) Encode

func (t TagListOpts) Encode() string

type Token

type Token struct {
	Token    string    `json:"token"`
	ExpireAt time.Time `json:"expireAt"`
}

type User

type User struct {
	ID        string     `json:"id"`
	Login     string     `json:"login"`
	Password  string     `json:"password"`
	Name      string     `json:"name"`
	ImageID   string     `json:"imageId"`
	Hash      string     `json:"-"`
	Role      UserRole   `json:"role"`
	Status    UserStatus `json:"status"`
	LastSeen  field.Time `json:"lastSeen"`
	CreatedAt field.Time `json:"createdAt"`
	UpdatedAt field.Time `json:"updatedAt"`
}

type UserRole

type UserRole int

type UserStatus

type UserStatus int

Jump to

Keyboard shortcuts

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