Documentation
¶
Index ¶
- type Account
- type Asset
- type AssetDetail
- type AssetPage
- type AssetQuery
- type Client
- func (c *Client) CreateConnectionToken(ctx context.Context, request ConnectionRequest) (string, error)
- func (c *Client) GetAsset(ctx context.Context, id string) (AssetDetail, error)
- func (c *Client) GetClientConnection(ctx context.Context, connectionTokenID string) (ClientConnection, error)
- func (c *Client) ListAssets(ctx context.Context, query AssetQuery) (AssetPage, error)
- func (c *Client) ListOrganizations(ctx context.Context) ([]Organization, error)
- type ClientConnection
- type ConnectionCredential
- type ConnectionOptions
- type ConnectionRequest
- type Endpoint
- type LabelValue
- type Organization
- type Protocol
- type ProtocolSettings
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 AssetQuery ¶
type Client ¶
type Client struct {
Timezone string
// contains filtered or unexported fields
}
func (*Client) CreateConnectionToken ¶
func (*Client) GetClientConnection ¶
func (*Client) ListAssets ¶
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 ConnectionOptions ¶
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 ¶
func (*Endpoint) UnmarshalJSON ¶
type LabelValue ¶
func (*LabelValue) UnmarshalJSON ¶
func (v *LabelValue) UnmarshalJSON(data []byte) error
type Organization ¶
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"`
}
Click to show internal directories.
Click to hide internal directories.