teambition

package
v1.5.8 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HASH_SHA1   = "sha1"
	HASH_SHA256 = "sha256"
	HASH_MD5    = "md5"
)
View Source
const (
	OBJECT_COLLECTION = "collection"
	OBJECT_WORK       = "work"
)

Variables

This section is empty.

Functions

func Archive

func Archive(nodeid string) (err error)

func ArchiveProject

func ArchiveProject(token string, nodeid, projectid, name, targetdir string) (err error)

func CopyCollection

func CopyCollection(nodeid string, dstParentCollection Collection) error

func CopyWork

func CopyWork(nodeid string, dstParentCollection Collection) error

func DeleteCollection

func DeleteCollection(nodeid string) error

func DeleteWork

func DeleteWork(nodeid string) error

func GetToken

func GetToken(projectid, rootid string) (token string, err error)

token

func Login

func Login(clientid, pubkey, token, email, phone, pwd string) (access string, err error)

func LoginParams

func LoginParams() (clientid, token, publickey string, err error)

func MoveCollection

func MoveCollection(nodeid, dstParentNodeid string) error

func MoveWork

func MoveWork(nodeid, dstParentNodeid string) error

func RenameCollection

func RenameCollection(nodeid string, title string) error

func RenameWork

func RenameWork(nodeid string, title string) error

func TwoFactor

func TwoFactor(clientid, token, verify string) error

Types

type ArchiveInfo

type ArchiveInfo struct {
	ObjectType string `json:"boundToObjectType"`
	Created    string `json:"created"`
	Title      string `json:"subTitle"`
	ProjectId  string `json:"_projectId"`
	NodeId     string `json:"_boundToObjectId"`
}

func GetArchives

func GetArchives(projectid, objectType string) (list []ArchiveInfo, err error)

type Collection

type Collection struct {
	Nodeid          string `json:"_id"`
	Pinyin          string `json:"pinyin"`
	Title           string `json:"title"`
	ParentId        string `json:"_parentId"`
	ProjectId       string `json:"_projectId"`
	ObjectType      string `json:"objectType"`
	CollectionCount int    `json:"collectionCount"`
	WorkCount       int    `json:"workCount"`
	Updated         string `json:"updated"`
	Created         string `json:"created"`
}

func Collections

func Collections(nodeid, projectid string) (list []Collection, err error)

func CreateCollection

func CreateCollection(nodeid, projectid, name string) (c Collection, err error)

type MeConfig

type MeConfig struct {
	IsAdmin bool   `json:"isAdmin"`
	OrgId   string `json:"tenantId"`
	User    struct {
		ID     string `json:"id"`
		Email  string `json:"email"`
		Name   string `json:"name"`
		OpenId string `json:"openId"`
	}
}

func Batches

func Batches() (me MeConfig, err error)

type OAEP

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

"pkcs1_oaep"

func New

func New(hash string, pubkey, prikey string) *OAEP

func (*OAEP) Decrypt

func (o *OAEP) Decrypt(encrypted string) []byte

func (*OAEP) Encrypt

func (o *OAEP) Encrypt(msg []byte) string

type Org

type Org struct {
	OrganizationId      string `json:"_id"`
	Name                string `json:"name"`
	DefaultCollectionId string `json:"_defaultCollectionId"`
	IsPublic            bool   `json:"isPublic"`
	Projects            []Project
}

func Orgs

func Orgs(orgid string) (org Org, err error)

type Project

type Project struct {
	ProjectId        string `json:"_id"`
	Name             string `json:"name"`
	OrganizationId   string `json:"_organizationId"`
	RootCollectionId string `json:"_rootCollectionId"`
}

func Projects

func Projects(orgid string) (list []Project, err error)

注: 这个 orgid 比较特殊, 它是一个特殊的 orgid

type Role

type Role struct {
	RoleId         string   `json:"_id"`
	OrganizationId string   `json:"_organizationId"`
	Level          int      `json:"level"`
	Permissions    []string `json:"-"`
}

===================================== user =====================================

func Roles

func Roles() (list []Role, err error)

Organization 角色

type UploadInfo

type UploadInfo struct {
	FileKey      string `json:"fileKey"`
	FileName     string `json:"fileName"`
	FileType     string `json:"fileType"`
	FileSize     int    `json:"fileSize"`
	FileCategory string `json:"fileCategory"`
	Source       string `json:"source"`
	DownloadUrl  string `json:"downloadUrl"`
}

===================================== project =====================================

func UploadProjectFile

func UploadProjectFile(token, path string) (upload UploadInfo, err error)

func UploadProjectFileChunk

func UploadProjectFileChunk(token, path string) (upload UploadInfo, err error)

type Work

type Work struct {
	Nodeid      string `json:"_id"`
	FileKey     string `json:"fileKey"`
	FileName    string `json:"fileName"`
	FileSize    int    `json:"fileSize"`
	DownloadUrl string `json:"downloadUrl"`
	ProjectId   string `json:"_projectId"`
	ParentId    string `json:"_parentId"`
	ObjectType  string `json:"objectType"`
	Updated     string `json:"updated"`
	Created     string `json:"created"`
}

func CreateWork

func CreateWork(nodeid string, upload UploadInfo) (w Work, err error)

func Works

func Works(nodeid, projectid string) (list []Work, err error)

Jump to

Keyboard shortcuts

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