personalaccesstoken

package
v14.40.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package personalaccesstoken provides functionality for managing personal access tokens

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client represents a client for managing personal access tokens

func NewClient

func NewClient(config *config.Config) (*Client, error)

NewClient creates a new instance of Client

func (*Client) GetPersonalAccessToken

func (c *Client) GetPersonalAccessToken(ctx context.Context, args *commandargs.Shell, name string, scopes *[]string, expiresAt string) (*Response, error)

GetPersonalAccessToken retrieves or creates a personal access token

type RequestBody

type RequestBody struct {
	KeyID     string   `json:"key_id,omitempty"`
	UserID    int64    `json:"user_id,omitempty"`
	Name      string   `json:"name"`
	Scopes    []string `json:"scopes"`
	ExpiresAt string   `json:"expires_at,omitempty"`
}

RequestBody represents the request body for creating a personal access token

type Response

type Response struct {
	Success   bool     `json:"success"`
	Token     string   `json:"token"`
	Scopes    []string `json:"scopes"`
	ExpiresAt string   `json:"expires_at"`
	Message   string   `json:"message"`
}

Response represents the response from creating a personal access token

Jump to

Keyboard shortcuts

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