api

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidAuthn = errors.New("credentials not valid")
View Source
var ErrInvalidAuthz = errors.New("credentials not authorized to access resource")
View Source
var ErrNotFound = errors.New("requested resource not found")
View Source
var ErrUnexpectedStatus = errors.New("unexpected HTTP status code")

Functions

func DeleteIntegration

func DeleteIntegration(so SnykOptions, orgId string, intType string) error

func DeleteOrganization

func DeleteOrganization(so SnykOptions, id string) error

func DeleteProject

func DeleteProject(so SnykOptions, orgId string, intType string) error

func IntegrationExists

func IntegrationExists(so SnykOptions, org string, intType string) (bool, error)

func OrganizationExistsByName

func OrganizationExistsByName(so SnykOptions, name string) (bool, error)

Types

type AttributesRest added in v0.4.3

type AttributesRest struct {
	Name   string `json:"name"`
	Origin string `json:"origin"`
}

type ImportStatus

type ImportStatus struct {
	ID     string `json:"id"`
	Status string `json:"status"`
}

type Integration

type Integration struct {
	Id          string                 `json:"id,omitempty"`
	OrgId       string                 `json:"-"`
	Type        string                 `json:"type"`
	Credentials IntegrationCredentials `json:"credentials"`
}

func CreateIntegration

func CreateIntegration(so SnykOptions, orgId string, intType string, creds IntegrationCredentials) (*Integration, error)

func GetIntegration

func GetIntegration(so SnykOptions, orgId string, intType string) (*Integration, error)

func UpdateIntegration

func UpdateIntegration(so SnykOptions, orgId string, intType string, creds IntegrationCredentials) (*Integration, error)

type IntegrationCredentials

type IntegrationCredentials struct {
	Username     string `json:"username,omitempty"`
	Password     string `json:"password,omitempty"`
	RegistryBase string `json:"registryBase,omitempty"`
	Url          string `json:"url,omitempty"`
	Token        string `json:"token,omitempty"`
	Region       string `json:"region,omitempty"`
	RoleArn      string `json:"roleArn,omitempty"`
}

type Organization

type Organization struct {
	Id      string    `json:"id,omitempty"`
	Name    string    `json:"name"`
	Slug    string    `json:"slug"`
	Url     string    `json:"url"`
	Created time.Time `json:"created,omitempty"`
}

func CreateOrganization

func CreateOrganization(so SnykOptions, name string) (*Organization, error)

func GetOrganization

func GetOrganization(so SnykOptions, id string) (*Organization, error)

type OwnerDetails

type OwnerDetails struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

func GetProjectOwner

func GetProjectOwner(so SnykOptions, orgId string, intType string) (*OwnerDetails, error)

type Projects

type Projects struct {
	Id     string `json:"id"`
	Name   string `json:"name"`
	Origin string `json:"origin"`
	Branch string `json:"branch"`
	Owner  OwnerDetails
}

func GetProjectById

func GetProjectById(so SnykOptions, orgId string, intType string) (*Projects, error)

func UpdateProject

func UpdateProject(so SnykOptions, id string, orgId string, integration string, repository_owner string, repository_name string, branch string) (*Projects, error)

type ProjectsRest added in v0.4.3

type ProjectsRest struct {
	Id         string `json:"id"`
	Attributes AttributesRest
}

func GetAllProjects

func GetAllProjects(so SnykOptions, orgId string) ([]ProjectsRest, error)

func GetProjectByName

func GetProjectByName(so SnykOptions, orgId string, name string) (*ProjectsRest, error)

type SnykOptions

type SnykOptions struct {
	GroupId   string
	ApiKey    string
	UserAgent string
}

type Target

type Target struct {
	Owner  string `json:"owner"`
	Name   string `json:"name"`
	Branch string `json:"branch"`
	Id     string `json:"id,omitempty"`
}

func ImportProject

func ImportProject(so SnykOptions, orgId string, integration string, repository_owner string, repository_name string, branch string) (*Target, error)

type TargetImport

type TargetImport struct {
	Target Target `json:"target"`
}

Jump to

Keyboard shortcuts

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