describer

package
v0.22.1 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Overview

artifact_dockerfile.go

commit.go

Index

Constants

View Source
const MAX_REPOS_TO_LIST = 250

MAX_REPOS_TO_LIST is how many repositories to fetch at most when listing.

View Source
const MAX_RESULTS = 500

MAX_RESULTS is the maximum number of Dockerfiles to collect or stream.

Variables

This section is empty.

Functions

func GetActionRunner added in v0.1.13

func GetActionRunner(ctx context.Context, githubClient GitHubClient, organizationName string, repositoryName string, resourceID string, stream *models.StreamSender) (*models.Resource, error)

func GetAllArtifacts

func GetAllArtifacts(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllAuditLogs

func GetAllAuditLogs(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllBranchProtections

func GetAllBranchProtections(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllBranches

func GetAllBranches(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllMembers

func GetAllMembers(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllOrganizationsCollaborators

func GetAllOrganizationsCollaborators(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllOrganizationsDependabotAlerts

func GetAllOrganizationsDependabotAlerts(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllPullRequests

func GetAllPullRequests(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllRepositoriesCollaborators

func GetAllRepositoriesCollaborators(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllRepositoriesDependabotAlerts

func GetAllRepositoriesDependabotAlerts(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllRepositoriesDeployments

func GetAllRepositoriesDeployments(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllRepositoriesEnvironments

func GetAllRepositoriesEnvironments(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllRepositoriesRuleSets

func GetAllRepositoriesRuleSets(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllRepositoriesSBOMs

func GetAllRepositoriesSBOMs(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllRepositoriesVulnerabilities

func GetAllRepositoriesVulnerabilities(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllRunners

func GetAllRunners(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllSecrets

func GetAllSecrets(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllTags

func GetAllTags(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllTeamsMembers

func GetAllTeamsMembers(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllWorkflowRuns

func GetAllWorkflowRuns(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllWorkflows

func GetAllWorkflows(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetArtifact

func GetArtifact(ctx context.Context, githubClient GitHubClient, organizationName string, repositoryName string, resourceID string, stream *models.StreamSender) (*models.Resource, error)

func GetContainerPackageList added in v0.3.0

func GetContainerPackageList(
	ctx context.Context,
	githubClient GitHubClient,
	organizationName string,
	stream *models.StreamSender,
) ([]models.Resource, error)

----------------------------------------------------------------------------- 1. GetContainerPackageList -----------------------------------------------------------------------------

func GetDockerfile added in v0.11.1

func GetDockerfile(ctx context.Context, githubClient GitHubClient, organizationName, repoFullName, filePath string, stream *models.StreamSender) (*models.Resource, error)

GetDockerfile fetches the details and content of a single Dockerfile given the repo and file path. It returns a fully populated resource with Dockerfile content, line count checks, and last updated at info.

func GetIssue added in v0.1.13

func GetIssue(ctx context.Context, githubClient GitHubClient, organizationName string, repositoryName string, resourceID string, stream *models.StreamSender) (*models.Resource, error)

func GetIssueList

func GetIssueList(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetLicense added in v0.1.13

func GetLicense(ctx context.Context, githubClient GitHubClient, organizationName string, repositoryName string, resourceID string, stream *models.StreamSender) (*models.Resource, error)

func GetLicenseList

func GetLicenseList(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetLoggerFromContext

func GetLoggerFromContext(ctx context.Context) *zap.Logger

func GetMavenPackageList added in v0.3.0

func GetMavenPackageList(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetNPMPackageList added in v0.3.0

func GetNPMPackageList(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetNugetPackage added in v0.3.0

func GetNugetPackage(ctx context.Context, githubClient GitHubClient, organizationName string, repositoryName string, resourceID string, stream *models.StreamSender) (*models.Resource, error)

func GetNugetPackageList added in v0.3.0

func GetNugetPackageList(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetOrganizationCollaborators

func GetOrganizationCollaborators(ctx context.Context, githubClient GitHubClient, stream *models.StreamSender, org string) ([]models.Resource, error)

func GetOrganizationDependabotAlerts

func GetOrganizationDependabotAlerts(ctx context.Context, githubClient GitHubClient, stream *models.StreamSender, org string) ([]models.Resource, error)

func GetOrganizationHooks

func GetOrganizationHooks(ctx context.Context, client *github.Client, org steampipemodels.OrganizationWithCounts) ([]*github.Hook, error)

func GetOrganizationList

func GetOrganizationList(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetOrganizationMembers

func GetOrganizationMembers(ctx context.Context, githubClient GitHubClient, stream *models.StreamSender, org string) ([]models.Resource, error)

func GetOrganizationTeamList added in v0.16.0

func GetOrganizationTeamList(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetParameterFromContext

func GetParameterFromContext(ctx context.Context, key string) any

func GetReleaseList added in v0.1.4

func GetReleaseList(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetRepoActionSecret added in v0.1.13

func GetRepoActionSecret(ctx context.Context, githubClient GitHubClient, organizationName string, repositoryName string, resourceID string, stream *models.StreamSender) (*models.Resource, error)

func GetRepository added in v0.1.16

func GetRepository(
	ctx context.Context,
	githubClient GitHubClient,
	organizationName string,
	repositoryName string,
	resourceID string,
	stream *models.StreamSender,
) (*models.Resource, error)

GetRepository fetches a single repo, transforms it, fetches languages, enriches metrics, returns a single Resource.

func GetRepositoryArtifacts

func GetRepositoryArtifacts(ctx context.Context, githubClient GitHubClient, stream *models.StreamSender, owner, repo string) ([]models.Resource, error)

func GetRepositoryAuditLog

func GetRepositoryAuditLog(ctx context.Context, githubClient GitHubClient, stream *models.StreamSender, org string) ([]models.Resource, error)

func GetRepositoryBranch added in v0.1.13

func GetRepositoryBranch(ctx context.Context, githubClient GitHubClient, organizationName string, repositoryName string, branchName string, stream *models.StreamSender) (*models.Resource, error)

func GetRepositoryBranchProtections

func GetRepositoryBranchProtections(ctx context.Context, githubClient GitHubClient, stream *models.StreamSender, owner, repo string) ([]models.Resource, error)

func GetRepositoryBranches

func GetRepositoryBranches(ctx context.Context, githubClient GitHubClient, stream *models.StreamSender, owner, repo string) ([]models.Resource, error)

func GetRepositoryCollaborators

func GetRepositoryCollaborators(ctx context.Context, githubClient GitHubClient, stream *models.StreamSender, owner, repo string) ([]models.Resource, error)

func GetRepositoryCommits

func GetRepositoryCommits(ctx context.Context, sdk *resilientbridge.ResilientBridge, stream *models.StreamSender, owner, repo string) ([]models.Resource, error)

GetRepositoryCommits fetches up to 50 commits for a single repository. If a stream is provided, commits are streamed; otherwise, returns them as a slice.

func GetRepositoryDependabotAlerts

func GetRepositoryDependabotAlerts(ctx context.Context, githubClient GitHubClient, stream *models.StreamSender, owner, repo string) ([]models.Resource, error)

func GetRepositoryDeployments

func GetRepositoryDeployments(ctx context.Context, githubClient GitHubClient, stream *models.StreamSender, owner, repo string) ([]models.Resource, error)

func GetRepositoryEnvironments

func GetRepositoryEnvironments(ctx context.Context, githubClient GitHubClient, stream *models.StreamSender, owner, repo string) ([]models.Resource, error)

func GetRepositoryList

func GetRepositoryList(
	ctx context.Context,
	githubClient GitHubClient,
	organizationName string,
	stream *models.StreamSender,
) ([]models.Resource, error)

GetRepositoryList calls GetRepositoryListWithOptions with default excludes (false, false).

func GetRepositoryListWithOptions added in v0.10.2

func GetRepositoryListWithOptions(
	ctx context.Context,
	githubClient GitHubClient,
	organizationName string,
	stream *models.StreamSender,
	excludeArchived bool,
	excludeDisabled bool,
) ([]models.Resource, error)

GetRepositoryListWithOptions enumerates org repositories, but *instead of streaming each raw JSON*, it calls GetRepository(...) for each repo, so that *only the final detail* from GetRepository is streamed and returned.

func GetRepositoryRuleSets

func GetRepositoryRuleSets(ctx context.Context, githubClient GitHubClient, stream *models.StreamSender, owner, repo string) ([]models.Resource, error)

func GetRepositoryRunners

func GetRepositoryRunners(ctx context.Context, githubClient GitHubClient, stream *models.StreamSender, owner, repo string) ([]models.Resource, error)

func GetRepositorySBOMs

func GetRepositorySBOMs(ctx context.Context, githubClient GitHubClient, owner, repo string) (*models.Resource, error)

func GetRepositorySecrets

func GetRepositorySecrets(ctx context.Context, githubClient GitHubClient, stream *models.StreamSender, owner, repo string) ([]models.Resource, error)

func GetRepositoryTags

func GetRepositoryTags(ctx context.Context, githubClient GitHubClient, stream *models.StreamSender, owner, repo string) ([]models.Resource, error)

func GetRepositoryVulnerabilities

func GetRepositoryVulnerabilities(ctx context.Context, githubClient GitHubClient, stream *models.StreamSender, owner, repo string) ([]models.Resource, error)

func GetRepositoryWorkflow added in v0.1.13

func GetRepositoryWorkflow(ctx context.Context, githubClient GitHubClient, organizationName string, repositoryName string, resourceID string, stream *models.StreamSender) (*models.Resource, error)

func GetRepositoryWorkflowRuns

func GetRepositoryWorkflowRuns(ctx context.Context, sdk *resilientbridge.ResilientBridge, stream *models.StreamSender, owner, repo string, runNumbers []runNumberCriterion) ([]models.Resource, error)

func GetRepositoryWorkflows

func GetRepositoryWorkflows(ctx context.Context, githubClient GitHubClient, stream *models.StreamSender, owner, repo string) ([]models.Resource, error)

func GetStarList

func GetStarList(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetTriggerTypeFromContext

func GetTriggerTypeFromContext(ctx context.Context) enums.DescribeTriggerType

func GetUser

func GetUser(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func ListArtifactDockerFiles added in v0.4.0

func ListArtifactDockerFiles(
	ctx context.Context,
	githubClient GitHubClient,
	organizationName string,
	stream *models.StreamSender,
) ([]models.Resource, error)

ListDockerFile lists references to Dockerfiles in all repositories for the given organization. If a stream is provided, results are streamed. If not, a slice of resources is returned.

func ListCommits added in v0.9.3

func ListCommits(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

ListCommits fetches commits from all active repositories under the specified organization. If a stream is provided, each commit is sent to the stream as it’s processed. Otherwise, commits are collected and returned as a slice.

func ListRepositoryPullRequests added in v0.1.13

func ListRepositoryPullRequests(ctx context.Context, githubClient GitHubClient, stream *models.StreamSender, owner, repo string) ([]models.Resource, error)

func WithLogger

func WithLogger(ctx context.Context, logger *zap.Logger) context.Context

Types

type CollaboratorEdge

type CollaboratorEdge struct {
	Permission githubv4.RepositoryPermission     `graphql:"permission @include(if:$includeOCPermission)" json:"permission"`
	Node       steampipemodels.CollaboratorLogin `graphql:"node @include(if:$includeOCNode)" json:"node"`
}

type FileContent

type FileContent struct {
	Repository string
	FilePath   string
	Content    string
}

type GitHubClient

type GitHubClient struct {
	RestClient    *github.Client
	GraphQLClient *githubv4.Client
	Token         string
}

GitHubClient custom struct for defining both rest and graphql clients

type JSONAllFieldsMarshaller

type JSONAllFieldsMarshaller struct {
	Value interface{}
}

func (JSONAllFieldsMarshaller) MarshalJSON

func (x JSONAllFieldsMarshaller) MarshalJSON() (res []byte, err error)

func (*JSONAllFieldsMarshaller) UnmarshalJSON

func (x *JSONAllFieldsMarshaller) UnmarshalJSON(data []byte) (err error)

Jump to

Keyboard shortcuts

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