user

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrepareCreateToken

func PrepareCreateToken(roundTripper *mhttp.MockRoundTripper, rootURL,
	user, passwd, newTokenName, targetUser string) (response *http.Response)

PrepareCreateToken only for test

func PrepareCreateUser

func PrepareCreateUser(roundTripper *mhttp.MockRoundTripper, rootURL,
	user, passwd, targetUserName string) (response *http.Response)

PrepareCreateUser only for test

func PrepareForDeleteUser

func PrepareForDeleteUser(roundTripper *mhttp.MockRoundTripper, rootURL, userName, user, passwd string) (
	response *http.Response)

PrepareForDeleteUser only for test

func PrepareForEditUserDesc

func PrepareForEditUserDesc(roundTripper *mhttp.MockRoundTripper, rootURL, userName, description, user, passwd string)

PrepareForEditUserDesc only for test

func PrepareGetUser

func PrepareGetUser(roundTripper *mhttp.MockRoundTripper, rootURL, user, passwd string) (
	response *http.Response)

PrepareGetUser only for test

Types

type Client

type Client struct {
	core.JenkinsCore
}

Client for connect the user

func (*Client) Create

func (q *Client) Create(username, password string) (user *ForCreate, err error)

Create will create a user in Jenkins

func (*Client) CreateToken

func (q *Client) CreateToken(targetUser, newTokenName string) (status *Token, err error)

CreateToken create a token in Jenkins

func (*Client) Delete

func (q *Client) Delete(username string) (err error)

Delete will remove a user from Jenkins

func (*Client) EditDesc

func (q *Client) EditDesc(description string) (err error)

EditDesc update the description of a user

func (*Client) Get

func (q *Client) Get() (status *User, err error)

Get returns a user's detail

type ForCreate

type ForCreate struct {
	User      `json:",inline"`
	Username  string `json:"username"`
	Password1 string `json:"password1"`
	Password2 string `json:"password2"`
	Email     string `json:"email"`
}

ForCreate is the data for creating a user

type Token

type Token struct {
	Status string    `json:"status"`
	Data   TokenData `json:"data"`
}

Token is the token of user

type TokenData

type TokenData struct {
	TokenName  string `json:"tokenName"`
	TokenUUID  string `json:"tokenUuid"`
	TokenValue string `json:"tokenValue"`
	UserName   string `json:"userName"`
}

TokenData represents the token

type User

type User struct {
	AbsoluteURL string `json:"absoluteUrl"`
	Description string
	FullName    string `json:"fullname"`
	ID          string
}

User for Jenkins

Jump to

Keyboard shortcuts

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