github

package
v1.372.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSSHKeysFromGitHubTeam

func GetSSHKeysFromGitHubTeam(client GitHubClient, org, teamSlug string) (string, error)

GetSSHKeysFromGitHubTeam fetches the public SSH keys of all members of the specified GitHub team and formats them for inclusion in instance metadata.

Types

type GitHubClient

type GitHubClient interface {
	GetTeamMemberSSHKeys(ctx context.Context, org, teamSlug string) ([]TeamMemberKeys, error)
}

GitHubClient abstracts the GitHub API call used to fetch team SSH keys.

type MockGitHubClient

type MockGitHubClient struct {
	mock.Mock
}

MockGitHubClient is an autogenerated mock type for the GitHubClient type

func NewMockGitHubClient

func NewMockGitHubClient(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockGitHubClient

NewMockGitHubClient creates a new instance of MockGitHubClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockGitHubClient) EXPECT

func (*MockGitHubClient) GetTeamMemberSSHKeys added in v1.366.0

func (_mock *MockGitHubClient) GetTeamMemberSSHKeys(ctx context.Context, org string, teamSlug string) ([]TeamMemberKeys, error)

GetTeamMemberSSHKeys provides a mock function for the type MockGitHubClient

type MockGitHubClient_Expecter

type MockGitHubClient_Expecter struct {
	// contains filtered or unexported fields
}

func (*MockGitHubClient_Expecter) GetTeamMemberSSHKeys added in v1.366.0

func (_e *MockGitHubClient_Expecter) GetTeamMemberSSHKeys(ctx any, org any, teamSlug any) *MockGitHubClient_GetTeamMemberSSHKeys_Call

GetTeamMemberSSHKeys is a helper method to define mock.On call

  • ctx context.Context
  • org string
  • teamSlug string

type MockGitHubClient_GetTeamMemberSSHKeys_Call added in v1.366.0

type MockGitHubClient_GetTeamMemberSSHKeys_Call struct {
	*mock.Call
}

MockGitHubClient_GetTeamMemberSSHKeys_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTeamMemberSSHKeys'

func (*MockGitHubClient_GetTeamMemberSSHKeys_Call) Return added in v1.366.0

func (*MockGitHubClient_GetTeamMemberSSHKeys_Call) Run added in v1.366.0

func (*MockGitHubClient_GetTeamMemberSSHKeys_Call) RunAndReturn added in v1.366.0

type RealGitHubClient

type RealGitHubClient struct {
	// contains filtered or unexported fields
}

func NewGitHubClient

func NewGitHubClient(ctx context.Context, token string) (*RealGitHubClient, error)

NewGitHubClient creates a new RealGitHubClient with the provided OAuth token.

func (*RealGitHubClient) GetTeamMemberSSHKeys added in v1.366.0

func (c *RealGitHubClient) GetTeamMemberSSHKeys(ctx context.Context, org, teamSlug string) ([]TeamMemberKeys, error)

GetTeamMemberSSHKeys fetches all members of the team and their public SSH keys via the GitHub GraphQL API, following member pagination until every member has been retrieved.

type TeamMemberKeys added in v1.366.0

type TeamMemberKeys struct {
	Login string
	Keys  []string
}

TeamMemberKeys holds a team member's login and their public SSH keys.

Jump to

Keyboard shortcuts

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