systemconfig

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	GitLabProvider  = "gitlab"
	GitHubProvider  = "github"
	GerritProvider  = "gerrit"
	CodeHubProvider = "codehub"
	GiteeProvider   = "gitee"
	GiteeEEProvider = "gitee-enterprise"
	OtherProvider   = "other"
)

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) GetLDAPConnector

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

func (*Client) GetRawCodeHost added in v1.9.9

func (c *Client) GetRawCodeHost(id int) (*CodeHost, 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"`
	Alias              string         `json:"alias,omitempty"`
	AuthType           types.AuthType `json:"auth_type,omitempty"`
	SSHKey             string         `json:"ssh_key,omitempty"`
	PrivateAccessToken string         `json:"private_access_token,omitempty"`
}

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 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