systemconfig

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2022 License: Apache-2.0 Imports: 5 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"
)

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

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

func (*Client) ListConnectors

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

type CodeHost

type CodeHost struct {
	ID          int    `json:"id"`
	Address     string `json:"address"`
	Type        string `json:"type"`
	AccessToken string `json:"access_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"`
}

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
	CodeHostID   int
}

Jump to

Keyboard shortcuts

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