api

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: BSD-2-Clause Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DefaultConnectTimeout = 1
View Source
const DefaultReadTimeout = 10

Variables

This section is empty.

Functions

func CheckTokenExpiry

func CheckTokenExpiry(client *DSClient, token string) (bool, error)

// Verifies the active status of JWT token

func GetDeviceCode

func GetDeviceCode(client *DSClient) (string, string, string, int, int, error)

func GetRepoStatus

func GetRepoStatus(client *DSClient, owner string, repoName string, provider string) (bool, error)

func GetSupportedAnalyzers

func GetSupportedAnalyzers(client *DSClient) ([]string, []string, []string, map[string]string, error)

func GetSupportedTransformers

func GetSupportedTransformers(client *DSClient) ([]string, []string, map[string]string, error)

Types

type AnalyzersQueryResponse

type AnalyzersQueryResponse struct {
	Analyzers struct {
		Edges []struct {
			Node struct {
				Name       string `json:"name"`
				Shortcode  string `json:"shortcode"`
				MetaSchema string `json:"metaSchema"`
			} `json:"node"`
		} `json:"edges"`
	} `json:"analyzers"`
}

type DSClient

type DSClient struct {
	Token string
	// contains filtered or unexported fields
}

func NewDSClient

func NewDSClient(host string, token string) *DSClient

type FetchJWTResponse

type FetchJWTResponse struct {
	Requestjwt struct {
		Payload struct {
			Email   string `json:"email"`
			Exp     string `json:"exp"`
			Origiat int64  `json:"origIat"`
		} `json:"payload"`
		Token            string `json:"token"`
		Refreshtoken     string `json:"refreshToken"`
		Refreshexpiresin int64  `json:"refreshExpiresIn"`
	} `json:"requestJwt"`
}

func GetJWT

func GetJWT(client *DSClient, deviceCode string) (*FetchJWTResponse, error)

Fetches JWT

type IssuesListFileResponse

type IssuesListFileResponse struct {
	Repository struct {
		File struct {
			Issues struct {
				Edges []struct {
					Node struct {
						Path          string `json:"path"`
						Beginline     int    `json:"beginLine"`
						Endline       int    `json:"endLine"`
						Concreteissue struct {
							Analyzer struct {
								Shortcode string `json:"shortcode"`
							} `json:"analyzer"`
							Title     string `json:"title"`
							Shortcode string `json:"shortcode"`
						} `json:"concreteIssue"`
					} `json:"node"`
				} `json:"edges"`
			} `json:"issues"`
		} `json:"file"`
	} `json:"repository"`
}

func GetIssuesForFile

func GetIssuesForFile(client *DSClient, owner string, repoName string, provider string, filePath string, limit int) (*IssuesListFileResponse, error)

type IssuesListResponse

type IssuesListResponse struct {
	Repository struct {
		Issues struct {
			Edges []struct {
				Node struct {
					Path          string `json:"path"`
					Beginline     int    `json:"beginLine"`
					Endline       int    `json:"endLine"`
					Concreteissue struct {
						Analyzer struct {
							Shortcode string `json:"shortcode"`
						} `json:"analyzer"`
						Title     string `json:"title"`
						Shortcode string `json:"shortcode"`
					} `json:"concreteIssue"`
				} `json:"node"`
			} `json:"edges"`
		} `json:"issues"`
	} `json:"repository"`
}

func GetIssues

func GetIssues(client *DSClient, owner string, repoName string, provider string, limit int) (*IssuesListResponse, error)

type RefreshAuthResponse

type RefreshAuthResponse struct {
	Refreshtoken struct {
		Token   string `json:"token"`
		Payload struct {
			Email   string `json:"email"`
			Exp     string `json:"exp"`
			Origiat int64  `json:"origIat"`
		} `json:"payload"`
		Refreshexpiresin int64  `json:"refreshExpiresIn"`
		Refreshtoken     string `json:"refreshToken"`
	} `json:"refreshToken"`
}

func RefreshAuthCreds

func RefreshAuthCreds(client *DSClient, refreshToken string) (*RefreshAuthResponse, error)

type RepoStatusResponse

type RepoStatusResponse struct {
	Repository struct {
		Isactivated bool `json:"isActivated"`
	} `json:"repository"`
}

type TransformersQueryResponse

type TransformersQueryResponse struct {
	Transformers struct {
		Edges []struct {
			Node struct {
				Name      string `json:"name"`
				Shortcode string `json:"shortcode"`
			} `json:"node"`
		} `json:"edges"`
	} `json:"transformers"`
}

type VerifyJWTResponse

type VerifyJWTResponse struct {
	Verifytoken struct {
		Payload struct {
			Email   string `json:"email"`
			Exp     int    `json:"exp"`
			Origiat int    `json:"origIat"`
		} `json:"payload"`
	} `json:"verifyToken"`
}

Jump to

Keyboard shortcuts

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