jumpserver

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 12 Imported by: 0 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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID       string       `json:"id"`
	Name     string       `json:"name"`
	Alias    string       `json:"alias"`
	Username string       `json:"username"`
	Actions  []LabelValue `json:"actions"`
}

type Asset

type Asset struct {
	ID       string     `json:"id"`
	Name     string     `json:"name"`
	Address  string     `json:"address"`
	Type     LabelValue `json:"type"`
	Category LabelValue `json:"category"`
}

type AssetDetail

type AssetDetail struct {
	Asset
	Accounts  []Account  `json:"permed_accounts"`
	Protocols []Protocol `json:"permed_protocols"`
}

type AssetPage

type AssetPage struct {
	Count    int     `json:"count"`
	Next     string  `json:"next"`
	Previous string  `json:"previous"`
	Results  []Asset `json:"results"`
}

type AssetQuery

type AssetQuery struct {
	Type     string
	Category string
	Offset   int
	Limit    int
	Search   string
	Order    string
}

type Client

type Client struct {
	Timezone string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(site, accessToken, organization string, httpClient *http.Client) (*Client, error)

func (*Client) CreateConnectionToken

func (c *Client) CreateConnectionToken(ctx context.Context, request ConnectionRequest) (string, error)

func (*Client) GetAsset

func (c *Client) GetAsset(ctx context.Context, id string) (AssetDetail, error)

func (*Client) GetClientConnection

func (c *Client) GetClientConnection(ctx context.Context, connectionTokenID string) (ClientConnection, error)

func (*Client) ListAssets

func (c *Client) ListAssets(ctx context.Context, query AssetQuery) (AssetPage, error)

func (*Client) ListOrganizations

func (c *Client) ListOrganizations(ctx context.Context) ([]Organization, error)

type ClientConnection

type ClientConnection struct {
	Protocol string               `json:"protocol"`
	Asset    Asset                `json:"asset"`
	Endpoint Endpoint             `json:"endpoint"`
	Token    ConnectionCredential `json:"token"`
}

func DecodeClientURL

func DecodeClientURL(raw string) (ClientConnection, error)

func (ClientConnection) Password

func (c ClientConnection) Password() string

func (ClientConnection) Username

func (c ClientConnection) Username() string

type ConnectionCredential

type ConnectionCredential struct {
	ID    string `json:"id"`
	Value string `json:"value"`
}

type ConnectionOptions

type ConnectionOptions struct {
	TokenReusable   bool `json:"token_reusable"`
	DisableAutoHash bool `json:"disableautohash"`
}

type ConnectionRequest

type ConnectionRequest struct {
	Asset          string            `json:"asset"`
	Account        string            `json:"account"`
	Protocol       string            `json:"protocol"`
	InputUsername  string            `json:"input_username"`
	InputSecret    string            `json:"input_secret"`
	ConnectMethod  string            `json:"connect_method"`
	ConnectOptions ConnectionOptions `json:"connect_options"`
}

type Endpoint

type Endpoint struct {
	Host string `json:"host"`
	Port int    `json:"-"`
}

func (*Endpoint) UnmarshalJSON

func (e *Endpoint) UnmarshalJSON(data []byte) error

type LabelValue

type LabelValue struct {
	Value string `json:"value"`
	Label string `json:"label,omitempty"`
}

func (*LabelValue) UnmarshalJSON

func (v *LabelValue) UnmarshalJSON(data []byte) error

type Organization

type Organization struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type Protocol

type Protocol struct {
	Name     string           `json:"name"`
	Port     int              `json:"port"`
	Settings ProtocolSettings `json:"setting"`
}

type ProtocolSettings

type ProtocolSettings struct {
	// nil 表示服务端未提供映射;空字符串由 KoKo 解释为账号 home。
	SFTPHome *string `json:"sftp_home,omitempty"`
}

Jump to

Keyboard shortcuts

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