Documentation
¶
Index ¶
- Variables
- type Client
- func (c *Client) Close() error
- func (c *Client) CreateAPIKey(ctx context.Context, expiration time.Duration) (string, time.Time, error)
- func (c *Client) CreatePreAuthKey(ctx context.Context, userID uint64, reusable bool, ephemeral bool, ...) (*v1.PreAuthKey, error)
- func (c *Client) CreateUser(ctx context.Context, username, displayName, email, pictureURL string) (*v1.User, error)
- func (c *Client) DeletePreAuthKey(ctx context.Context, id uint64) error
- func (c *Client) DeleteUser(ctx context.Context, userID uint64) error
- func (c *Client) ExpireAPIKey(ctx context.Context, prefix string) error
- func (c *Client) GetUserByName(ctx context.Context, username string) (*v1.User, error)
- func (c *Client) ListAPIKeys(ctx context.Context) ([]*v1.ApiKey, error)
- func (c *Client) WaitForReady(ctx context.Context, maxRetries int, retryInterval time.Duration) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUserNotFound = errors.New("user not found")
ErrUserNotFound is returned when a user is not found in Headscale
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps the Headscale gRPC client
func NewClientWithAPIKey ¶
NewClientWithAPIKey creates a new Headscale client connected via gRPC service with API key authentication
func (*Client) CreateAPIKey ¶
func (c *Client) CreateAPIKey(ctx context.Context, expiration time.Duration) (string, time.Time, error)
CreateAPIKey creates a new API key with the specified expiration
func (*Client) CreatePreAuthKey ¶
func (c *Client) CreatePreAuthKey( ctx context.Context, userID uint64, reusable bool, ephemeral bool, expiration time.Duration, tags []string, ) (*v1.PreAuthKey, error)
CreatePreAuthKey creates a new preauth key in Headscale
func (*Client) CreateUser ¶
func (c *Client) CreateUser(ctx context.Context, username, displayName, email, pictureURL string) (*v1.User, error)
CreateUser creates a new user in Headscale
func (*Client) DeletePreAuthKey ¶ added in v0.3.0
DeletePreAuthKey deletes a preauth key by key ID
func (*Client) DeleteUser ¶
DeleteUser deletes a user from Headscale by ID
func (*Client) ExpireAPIKey ¶
ExpireAPIKey expires an existing API key
func (*Client) GetUserByName ¶
GetUserByName retrieves a user from Headscale by name
func (*Client) ListAPIKeys ¶
ListAPIKeys lists all API keys
Click to show internal directories.
Click to hide internal directories.