buildin

package
v20.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuiltINData

type BuiltINData struct {
	Status string `json:"status"`
	Data   string `json:"data"`
	Md5    string `json:"md5"`
}

type Client

type Client struct {

	// build-in
	Login *LoginService
	// contains filtered or unexported fields
}

func NewBasicAuthClient

func NewBasicAuthClient(username, password string, options ...ClientOptionFunc) (*Client, error)

func (*Client) RequestURL

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

RequestURL restful api request url

func (*Client) RequestURLFmt

func (c *Client) RequestURLFmt(f string, v ...any) string

type ClientOptionFunc

type ClientOptionFunc func(*Client) error

func WithBaseURL

func WithBaseURL(urlStr string) ClientOptionFunc

WithBaseURL sets the base URL for API requests to a custom endpoint.

func WithDevMode

func WithDevMode() ClientOptionFunc

func WithDumpAll

func WithDumpAll() ClientOptionFunc

func WithUserAgent

func WithUserAgent(ua string) ClientOptionFunc

func WithZenTaoMode

func WithZenTaoMode(mode ZentaoMode) ClientOptionFunc

WithZenTaoMode sets the mode for Zentao built-in page requests.

func WithoutProxy

func WithoutProxy() ClientOptionFunc

WithoutProxy 禁用代理, 默认情况下会读取HTTP_PROXY/HTTPS_PROXY/http_proxy/https_proxy变量

type LoginRespData

type LoginRespData struct {
	Status string        `json:"status"`
	User   LoginUserData `json:"user"`
}

type LoginService

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

func (*LoginService) GetSessionID

func (s *LoginService) GetSessionID() (*string, *req.Response, error)

func (*LoginService) Login

func (s *LoginService) Login() (bool, *LoginRespData, *req.Response, error)

type LoginUserData

type LoginUserData struct {
	ID             string          `json:"id"`
	Company        string          `json:"company"`
	Type           string          `json:"type"`
	Dept           string          `json:"dept"`
	Account        string          `json:"account"`
	Role           string          `json:"role"`
	Realname       string          `json:"realname"`
	Pinyin         string          `json:"pinyin"`
	Nickname       string          `json:"nickname"`
	Commiter       string          `json:"commiter"`
	Avatar         string          `json:"avatar"`
	Birthday       string          `json:"birthday"`
	Gender         string          `json:"gender"`
	Email          string          `json:"email"`
	Skype          string          `json:"skype"`
	Qq             string          `json:"qq"`
	Mobile         string          `json:"mobile"`
	Phone          string          `json:"phone"`
	Weixin         string          `json:"weixin"`
	Dingding       string          `json:"dingding"`
	Slack          string          `json:"slack"`
	Whatsapp       string          `json:"whatsapp"`
	Address        string          `json:"address"`
	Zipcode        string          `json:"zipcode"`
	Nature         string          `json:"nature"`
	Analysis       string          `json:"analysis"`
	Strategy       string          `json:"strategy"`
	Join           string          `json:"join"`
	Visits         string          `json:"visits"`
	Visions        string          `json:"visions"`
	IP             string          `json:"ip"`
	Last           string          `json:"last"`
	Fails          string          `json:"fails"`
	Locked         string          `json:"locked"`
	Feedback       string          `json:"feedback"`
	Ranzhi         string          `json:"ranzhi"`
	Ldap           string          `json:"ldap"`
	Score          string          `json:"score"`
	ScoreLevel     string          `json:"scoreLevel"`
	ResetToken     string          `json:"resetToken"`
	ClientStatus   string          `json:"clientStatus"`
	ClientLang     string          `json:"clientLang"`
	LastTime       string          `json:"lastTime"`
	Admin          bool            `json:"admin"`
	ModifyPassword bool            `json:"modifyPassword"`
	Rights         LoginUserRights `json:"rights"`
	Groups         struct {
		Num13 string `json:"13"`
	} `json:"groups"`
	View  LoginUserView `json:"view"`
	Token string        `json:"token"`
}

type LoginUserRights

type LoginUserRights struct {
	Rights struct {
		Program struct {
			Activate                bool `json:"activate"`
			Batchunlinkstakeholders bool `json:"batchunlinkstakeholders"`
			Browse                  bool `json:"browse"`
			Close                   bool `json:"close"`
			Create                  bool `json:"create"`
			Createstakeholder       bool `json:"createstakeholder"`
			Delete                  bool `json:"delete"`
			Edit                    bool `json:"edit"`
			Kanban                  bool `json:"kanban"`
			Product                 bool `json:"product"`
			Project                 bool `json:"project"`
			Stakeholder             bool `json:"stakeholder"`
			Start                   bool `json:"start"`
			Suspend                 bool `json:"suspend"`
			Unbindwhitelist         bool `json:"unbindwhitelist"`
			Unlinkstakeholder       bool `json:"unlinkstakeholder"`
			Updateorder             bool `json:"updateorder"`
			View                    bool `json:"view"`
		} `json:"program"`
		Projectplan struct {
			Browse bool `json:"browse"`
		} `json:"projectplan"`
		Traincourse struct {
			Browse         bool `json:"browse"`
			Practice       bool `json:"practice"`
			Practicebrowse bool `json:"practicebrowse"`
			Practiceview   bool `json:"practiceview"`
			Updatepractice bool `json:"updatepractice"`
			Viewchapter    bool `json:"viewchapter"`
			Viewcourse     bool `json:"viewcourse"`
		} `json:"traincourse"`
		Index struct {
			Index int `json:"index"`
		} `json:"index"`
		My struct {
			Index int `json:"index"`
		} `json:"my"`
	} `json:"rights"`
	Acls       []any  `json:"acls"`
	Projects   string `json:"projects"`
	Programs   string `json:"programs"`
	Products   string `json:"products"`
	Executions string `json:"executions"`
}

type LoginUserView

type LoginUserView struct {
	Account  string `json:"account"`
	Programs string `json:"programs"`
	Products string `json:"products"`
	Projects string `json:"projects"`
	Sprints  string `json:"sprints"`
}

type SessionData

type SessionData struct {
	Title       string      `json:"title,omitempty"`
	SessionName string      `json:"sessionName,omitempty"`
	SessionID   string      `json:"sessionID"`
	Rand        int         `json:"rand,omitempty"`
	Pager       interface{} `json:"pager,omitempty"`
}

type ZentaoMode

type ZentaoMode string
const (
	ZentaoDefultMode ZentaoMode = "PATH_INFO"
	ZentaoGetMode    ZentaoMode = "GET"
)

func (ZentaoMode) String

func (z ZentaoMode) String() string

Jump to

Keyboard shortcuts

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