Documentation ¶
Overview ¶
DeepSource SDK
Index ¶
- type Client
- func (c Client) GQL() *graphql.Client
- func (c Client) GetIssues(ctx context.Context, owner, repoName, provider string, limit int) ([]issues.Issue, error)
- func (c Client) GetIssuesForFile(ctx context.Context, owner, repoName, provider, filePath string, limit int) ([]issues.Issue, error)
- func (c Client) GetRepoStatus(ctx context.Context, owner, repoName, provider string) (*repository.Meta, error)
- func (c Client) GetSupportedAnalyzers(ctx context.Context) ([]analyzers.Analyzer, error)
- func (c Client) GetSupportedTransformers(ctx context.Context) ([]transformers.Transformer, error)
- func (c Client) GetToken() string
- func (c Client) Login(ctx context.Context, deviceCode, description string) (*auth.PAT, error)
- func (c Client) RefreshAuthCreds(ctx context.Context, token string) (*auth.PAT, error)
- func (c Client) RegisterDevice(ctx context.Context) (*auth.Device, error)
- type ClientOpts
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 (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 ¶
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 ¶
Returns the PAT which is required for authentication and thus, interacting with the APIs
func (Client) Login ¶
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 ¶
Refreshes the authentication credentials. Takes the refreshToken as a parameter.