Documentation ¶
Index ¶
- Constants
- func OverrideGrpcLogger()
- type Client
- func (c *Client) AddUser(id, role string) error
- func (c *Client) Alive() bool
- func (c *Client) Close()
- func (c *Client) ClusterMemberList() ([]*rpc.ClusterMember, error)
- func (c *Client) DeleteUser(id string, role string) error
- func (c *Client) GetCert(serialNumber *big.Int) (*rpc.CertItem, error)
- func (c *Client) GetGPGKey(userId string) (string, error)
- func (c *Client) GetSSHKey(userId string) (string, error)
- func (c *Client) GetUser(id string, withToken bool) (*rpc.UserItem, error)
- func (c *Client) ListAgentBackend() ([]*rpc.BackendItem, error)
- func (c *Client) ListAllBackend() ([]*rpc.BackendItem, error)
- func (c *Client) ListAllUser() ([]*rpc.UserItem, error)
- func (c *Client) ListCert(opts ...RequestOpt) ([]*rpc.CertItem, error)
- func (c *Client) ListConnectedAgent() ([]*rpc.Agent, error)
- func (c *Client) ListRevokedCert() ([]*rpc.CertItem, error)
- func (c *Client) ListRole() ([]*rpc.RoleItem, error)
- func (c *Client) ListServiceAccount() ([]*rpc.UserItem, error)
- func (c *Client) ListUser(role string) ([]*rpc.UserItem, error)
- func (c *Client) NewAgentCert(commonName, comment string) error
- func (c *Client) NewAgentCertByCSR(csr string, commonName string) ([]byte, error)
- func (c *Client) NewCert(commonName, keyType string, keyBits int, password, comment string) error
- func (c *Client) NewCertByCSR(csr string, opts ...RequestOpt) (*rpc.CertItem, error)
- func (c *Client) NewServerCert(csr []byte) ([]byte, error)
- func (c *Client) NewServiceAccount(id, comment string) error
- func (c *Client) NewToken(name, userId string) (*rpc.AccessTokenItem, error)
- func (c *Client) RevokeCert(serialNumber *big.Int) error
- func (c *Client) SetGPGKey(key string) error
- func (c *Client) SetSSHKey(key string) error
- func (c *Client) ToggleAdmin(id string) error
- func (c *Client) UpdateUser(id string, user *rpc.UserItem) error
- func (c *Client) UserBecomeMaintainer(id, role string) error
- type ClientWithUserToken
- type RequestOpt
- type RevokedCert
- type RevokedCertificateWatcher
Constants ¶
View Source
const (
TokenHeaderName = "X-Auth-Token"
)
Variables ¶
This section is empty.
Functions ¶
func OverrideGrpcLogger ¶
func OverrideGrpcLogger()
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewWithClient ¶
func NewWithClient(a rpc.AdminClient, c rpc.ClusterClient, ca rpc.CertificateAuthorityClient, user rpc.UserClient) *Client
func NewWithInternalToken ¶
func NewWithInternalToken(conn *grpc.ClientConn, token string) (*Client, error)
func NewWithStaticToken ¶
func NewWithStaticToken(conn *grpc.ClientConn) (*Client, error)
func (*Client) ClusterMemberList ¶
func (c *Client) ClusterMemberList() ([]*rpc.ClusterMember, error)
func (*Client) ListAgentBackend ¶
func (c *Client) ListAgentBackend() ([]*rpc.BackendItem, error)
func (*Client) ListAllBackend ¶
func (c *Client) ListAllBackend() ([]*rpc.BackendItem, error)
func (*Client) NewAgentCert ¶
func (*Client) NewAgentCertByCSR ¶
func (*Client) NewCertByCSR ¶
func (*Client) NewServiceAccount ¶
func (*Client) NewToken ¶
func (c *Client) NewToken(name, userId string) (*rpc.AccessTokenItem, error)
func (*Client) ToggleAdmin ¶
func (*Client) UpdateUser ¶ added in v0.11.0
func (*Client) UserBecomeMaintainer ¶
type ClientWithUserToken ¶
type ClientWithUserToken struct {
*Client
}
func NewClientWithUserToken ¶
func NewClientWithUserToken(conn *grpc.ClientConn) *ClientWithUserToken
func (*ClientWithUserToken) WithRequest ¶
func (u *ClientWithUserToken) WithRequest(req *http.Request) *ClientWithUserToken
func (*ClientWithUserToken) WithToken ¶
func (u *ClientWithUserToken) WithToken(token string) *ClientWithUserToken
type RequestOpt ¶ added in v0.12.0
type RequestOpt func(interface{})
func Comment ¶ added in v0.12.0
func Comment(c string) RequestOpt
func CommonName ¶ added in v0.12.0
func CommonName(cn string) RequestOpt
func IsDevice ¶ added in v0.12.0
func IsDevice() RequestOpt
func OverrideCommonName ¶ added in v0.12.0
func OverrideCommonName(cn string) RequestOpt
func VerifyCommonName ¶ added in v0.12.0
func VerifyCommonName(cn string) RequestOpt
type RevokedCert ¶
type RevokedCertificateWatcher ¶
type RevokedCertificateWatcher struct {
// contains filtered or unexported fields
}
func NewRevokedCertificateWatcher ¶
func NewRevokedCertificateWatcher(conn *grpc.ClientConn, token string) (*RevokedCertificateWatcher, error)
func (*RevokedCertificateWatcher) Error ¶
func (w *RevokedCertificateWatcher) Error() error
func (*RevokedCertificateWatcher) Get ¶
func (w *RevokedCertificateWatcher) Get() []*RevokedCert
func (*RevokedCertificateWatcher) IsReady ¶
func (w *RevokedCertificateWatcher) IsReady() bool
Click to show internal directories.
Click to hide internal directories.