Documentation
¶
Index ¶
- func GetSSHKeysFromGitHubTeam(client GitHubClient, org, teamSlug string) (string, error)
- type GitHubClient
- type MockGitHubClient
- type MockGitHubClient_Expecter
- type MockGitHubClient_GetTeamMemberSSHKeys_Call
- func (_c *MockGitHubClient_GetTeamMemberSSHKeys_Call) Return(teamMemberKeyss []TeamMemberKeys, err error) *MockGitHubClient_GetTeamMemberSSHKeys_Call
- func (_c *MockGitHubClient_GetTeamMemberSSHKeys_Call) Run(run func(ctx context.Context, org string, teamSlug string)) *MockGitHubClient_GetTeamMemberSSHKeys_Call
- func (_c *MockGitHubClient_GetTeamMemberSSHKeys_Call) RunAndReturn(...) *MockGitHubClient_GetTeamMemberSSHKeys_Call
- type RealGitHubClient
- type TeamMemberKeys
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 ¶
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 (_m *MockGitHubClient) EXPECT() *MockGitHubClient_Expecter
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
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 (_c *MockGitHubClient_GetTeamMemberSSHKeys_Call) Return(teamMemberKeyss []TeamMemberKeys, err error) *MockGitHubClient_GetTeamMemberSSHKeys_Call
func (*MockGitHubClient_GetTeamMemberSSHKeys_Call) Run ¶ added in v1.366.0
func (_c *MockGitHubClient_GetTeamMemberSSHKeys_Call) Run(run func(ctx context.Context, org string, teamSlug string)) *MockGitHubClient_GetTeamMemberSSHKeys_Call
func (*MockGitHubClient_GetTeamMemberSSHKeys_Call) RunAndReturn ¶ added in v1.366.0
func (_c *MockGitHubClient_GetTeamMemberSSHKeys_Call) RunAndReturn(run func(ctx context.Context, org string, teamSlug string) ([]TeamMemberKeys, error)) *MockGitHubClient_GetTeamMemberSSHKeys_Call
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
TeamMemberKeys holds a team member's login and their public SSH keys.