youplus

package
v0.0.0-...-5fea7ce Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthResponse

type AuthResponse struct {
	Success  bool   `json:"success,omitempty"`
	Username string `json:"username,omitempty"`
	Uid      string `json:"uid,omitempty"`
}

type Client

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

func NewClient

func NewClient() *Client

func (*Client) CheckAuth

func (c *Client) CheckAuth(token string) (*AuthResponse, error)

CheckAuth get user info by token

func (*Client) FetchInfo

func (c *Client) FetchInfo() (*InfoResponse, error)

FetchInfo get service info

func (*Client) FetchUserAuth

func (c *Client) FetchUserAuth(username string, password string) (*UserAuthResponse, error)

FetchUserAuth fetch token with username and password

func (*Client) GetInfo

func (c *Client) GetInfo() (*GetInfoResponseBody, error)

func (*Client) GetRealPath

func (c *Client) GetRealPath(target string, token string) (string, error)

GetRealPath get realpath by youplus path

func (*Client) GetUrl

func (c *Client) GetUrl(path string) string

func (*Client) Init

func (c *Client) Init(baseUrl string)

Init client

func (*Client) ReadDir

func (c *Client) ReadDir(target string, token string) ([]ReadDirItem, error)

ReadDir readdir with youplus path

type GetInfoResponseBody

type GetInfoResponseBody struct {
	Name    string `json:"name"`
	Success bool   `json:"success"`
}

type GetRealPathResponseBody

type GetRealPathResponseBody struct {
	Path string `json:"path"`
}

type InfoResponse

type InfoResponse struct {
	Success bool `json:"success"`
}

type ReadDirItem

type ReadDirItem struct {
	RealPath string `json:"realPath"`
	Path     string `json:"path"`
	Type     string `json:"type"`
}

type UserAuthResponse

type UserAuthResponse struct {
	Success bool   `json:"success"`
	Token   string `json:"token"`
	Uid     string `json:"uid"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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