rpcclient

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TokenHeaderName = "X-Auth-Token"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewWithInternalToken

func NewWithInternalToken(conn *grpc.ClientConn, token string) (*Client, error)

func NewWithStaticToken

func NewWithStaticToken(conn *grpc.ClientConn) (*Client, error)

func (*Client) AddUser

func (c *Client) AddUser(id, role string) error

func (*Client) Alive

func (c *Client) Alive() bool

func (*Client) Close

func (c *Client) Close()

func (*Client) ClusterMemberList

func (c *Client) ClusterMemberList() ([]*rpc.ClusterMember, error)

func (*Client) DeleteUser

func (c *Client) DeleteUser(id string, role string) error

func (*Client) GetBackends added in v0.13.0

func (c *Client) GetBackends() ([]*rpc.BackendItem, error)

func (*Client) GetCert

func (c *Client) GetCert(serialNumber *big.Int) (*rpc.CertItem, error)

func (*Client) GetUser

func (c *Client) GetUser(id string, withToken bool) (*rpc.UserItem, error)

func (*Client) ListAgentBackend

func (c *Client) ListAgentBackend() ([]*rpc.BackendItem, error)

func (*Client) ListAllBackend

func (c *Client) ListAllBackend() ([]*rpc.BackendItem, error)

func (*Client) ListAllUser

func (c *Client) ListAllUser() ([]*rpc.UserItem, error)

func (*Client) ListCert

func (c *Client) ListCert(opts ...RequestOpt) ([]*rpc.CertItem, error)

func (*Client) ListConnectedAgent

func (c *Client) ListConnectedAgent() ([]*rpc.Agent, error)

func (*Client) ListRevokedCert

func (c *Client) ListRevokedCert() ([]*rpc.CertItem, error)

func (*Client) ListRole

func (c *Client) ListRole() ([]*rpc.RoleItem, error)

func (*Client) ListServiceAccount

func (c *Client) ListServiceAccount() ([]*rpc.UserItem, error)

func (*Client) ListUser

func (c *Client) ListUser(role string) ([]*rpc.UserItem, error)

func (*Client) NewAgentCert

func (c *Client) NewAgentCert(commonName, comment string) error

func (*Client) NewAgentCertByCSR

func (c *Client) NewAgentCertByCSR(csr string, commonName string) ([]byte, error)

func (*Client) NewCert

func (c *Client) NewCert(commonName, keyType string, keyBits int, password, comment string) error

func (*Client) NewCertByCSR

func (c *Client) NewCertByCSR(csr string, opts ...RequestOpt) (*rpc.CertItem, error)

func (*Client) NewServerCert

func (c *Client) NewServerCert(csr []byte) ([]byte, error)

func (*Client) NewServiceAccount

func (c *Client) NewServiceAccount(id, comment string) error

func (*Client) NewToken

func (c *Client) NewToken(name, userId string) (*rpc.AccessTokenItem, error)

func (*Client) RevokeCert

func (c *Client) RevokeCert(serialNumber *big.Int) error

func (*Client) ToggleAdmin

func (c *Client) ToggleAdmin(id string) error

func (*Client) UpdateUser added in v0.11.0

func (c *Client) UpdateUser(id string, user *rpc.UserItem) error

func (*Client) UserBecomeMaintainer

func (c *Client) UserBecomeMaintainer(id, role string) error

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 RevokedCert struct {
	SerialNumber *big.Int
}

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 (*RevokedCertificateWatcher) IsReady

func (w *RevokedCertificateWatcher) IsReady() bool

Jump to

Keyboard shortcuts

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