systemconfig

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GitLabProvider  = "gitlab"
	GitHubProvider  = "github"
	GerritProvider  = "gerrit"
	CodeHubProvider = "codehub"
	GiteeProvider   = "gitee"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*httpclient.Client
	// contains filtered or unexported fields
}

func New

func New() *Client

func (*Client) GetCodeHost

func (c *Client) GetCodeHost(id int) (*CodeHost, error)

func (*Client) GetCodeHostByAddressAndOwner

func (c *Client) GetCodeHostByAddressAndOwner(address, owner, source string) (*CodeHost, error)

func (*Client) GetEmailHost

func (c *Client) GetEmailHost() (*Email, error)

func (*Client) GetJiraInfo

func (c *Client) GetJiraInfo() (*JiraInfo, error)

func (*Client) GetLDAPConnector

func (c *Client) GetLDAPConnector(id string) (*Connector, error)

func (*Client) ListCodeHostsInternal added in v1.9.9

func (c *Client) ListCodeHostsInternal() ([]*CodeHost, error)

func (*Client) ListConnectorsInternal added in v1.9.9

func (c *Client) ListConnectorsInternal() ([]*Connector, error)

func (*Client) UpdateCodeHost added in v1.9.9

func (c *Client) UpdateCodeHost(id int, codehost *CodeHost) error

type CodeHost

type CodeHost struct {
	ID           int    `json:"id"`
	Address      string `json:"address"`
	Type         string `json:"type"`
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	Namespace    string `json:"namespace"`
	Region       string `json:"region"`
	// the field and tag not consistent because of db field
	AccessKey string `json:"application_id"`
	SecretKey string `json:"client_secret"`
	Username  string `json:"username"`
	Password  string `json:"password"`
	// the field determine whether the proxy is enabled
	EnableProxy bool  `json:"enable_proxy"`
	UpdatedAt   int64 `json:"updated_at"`
}

func GetCodeHostInfo

func GetCodeHostInfo(opt *Option) (*CodeHost, error)

type Connector

type Connector struct {
	Type   string      `json:"type"`
	ID     string      `json:"id"`
	Name   string      `json:"name"`
	Config interface{} `json:"config"`
}

type Email

type Email struct {
	Name     string `json:"name"`
	Port     int    `json:"port"`
	UserName string `json:"username"`
	Password string `json:"password"`
}

type JiraInfo

type JiraInfo struct {
	ID             int64  `json:"id"`
	Host           string `json:"host"`
	User           string `json:"user"`
	AccessToken    string `json:"access_token"`
	OrganizationID int    `json:"organizationId"`
	CreatedAt      int64  `json:"created_at"`
	UpdatedAt      int64  `json:"updated_at"`
}

type Option

type Option struct {
	CodeHostType string
	Address      string
	Namespace    string
}

Jump to

Keyboard shortcuts

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