api

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: MPL-2.0 Imports: 6 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 added in v0.2.0

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

func DeleteOrganization

func DeleteOrganization(so SnykOptions, id string) error

func IntegrationExists added in v0.2.0

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

func OrganizationExistsByName added in v0.2.0

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

Types

type Integration added in v0.2.0

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

func CreateIntegration added in v0.2.0

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

func GetIntegration added in v0.2.0

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

func UpdateIntegration added in v0.2.0

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

type IntegrationCredentials added in v0.2.0

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 SnykOptions

type SnykOptions struct {
	GroupId   string
	ApiKey    string
	UserAgent string
}

Jump to

Keyboard shortcuts

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