deepsource

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: BSD-2-Clause Imports: 13 Imported by: 0

Documentation

Overview

DeepSource SDK

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
}

func New

func New(cp ClientOpts) (*Client, error)

Returns a new GQLClient

func (Client) GQL

func (c Client) GQL() *graphql.Client

Returns a GraphQL client which can be used to interact with the GQL APIs

func (Client) GetIssues

func (c Client) GetIssues(ctx context.Context, owner, repoName, provider string, limit int) ([]issues.Issue, error)

Returns the list of issues for a certain repository whose data is sent as parameters. Owner : The username of the owner of the repository repoName : The name of the repository whose activation status has to be queried provider : The VCS provider which hosts the repo (GITHUB/GITLAB/BITBUCKET) limit : The amount of issues to be listed. The default limit is 30 while the maximum limit is currently 100.

func (Client) GetIssuesForFile

func (c Client) GetIssuesForFile(ctx context.Context, owner, repoName, provider, filePath string, limit int) ([]issues.Issue, error)

Returns the list of issues reported for a certain file in a certain repository whose data is sent as parameters. Owner : The username of the owner of the repository repoName : The name of the repository whose activation status has to be queried provider : The VCS provider which hosts the repo (GITHUB/GITLAB/BITBUCKET) filePath : The relative path of the file. Eg: "tests/mock.py" if a file `mock.py` is present in `tests` directory which in turn is present in the root dir limit : The amount of issues to be listed. The default limit is 30 while the maximum limit is currently 100.

func (Client) GetRepoStatus

func (c Client) GetRepoStatus(ctx context.Context, owner, repoName, provider string) (*repository.Meta, error)

Returns the activation status of the repository whose data is sent as parameters. Owner : The username of the owner of the repository repoName : The name of the repository whose activation status has to be queried provider : The VCS provider which hosts the repo (GITHUB/GITLAB/BITBUCKET)

func (Client) GetSupportedAnalyzers

func (c Client) GetSupportedAnalyzers(ctx context.Context) ([]analyzers.Analyzer, error)

Returns the list of Analyzers supported by DeepSource along with their meta like shortcode, metaschema.

func (Client) GetSupportedTransformers

func (c Client) GetSupportedTransformers(ctx context.Context) ([]transformers.Transformer, error)

Returns the list of Transformers supported by DeepSource along with their meta like shortcode.

func (Client) GetToken

func (c Client) GetToken() string

Returns the PAT which is required for authentication and thus, interacting with the APIs

func (Client) Login

func (c Client) Login(ctx context.Context, deviceCode, description string) (*auth.PAT, error)

Logs in the client using the deviceCode and the user Code and returns the PAT and data which is required for authentication

func (Client) RefreshAuthCreds

func (c Client) RefreshAuthCreds(ctx context.Context, token string) (*auth.PAT, error)

Refreshes the authentication credentials. Takes the refreshToken as a parameter.

func (Client) RegisterDevice

func (c Client) RegisterDevice(ctx context.Context) (*auth.Device, error)

Registers the device and allots it a device code which is further used for fetching the PAT and other authentication data

type ClientOpts

type ClientOpts struct {
	Token    string
	HostName string
}

Directories

Path Synopsis
queries
Lists the issues reported in a single file mentioned by the user
Lists the issues reported in a single file mentioned by the user

Jump to

Keyboard shortcuts

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