github

package
v1.53.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: Apache-2.0 Imports: 5 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 {
	ListTeamMembersBySlug(ctx context.Context, org, teamSlug string, opts *github.TeamListTeamMembersOptions) ([]*github.User, error)
	ListUserKeys(ctx context.Context, username string) ([]*github.Key, error)
}

GitHubClient abstracts the GitHub API calls 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) ListTeamMembersBySlug

func (_mock *MockGitHubClient) ListTeamMembersBySlug(ctx context.Context, org string, teamSlug string, opts *github.TeamListTeamMembersOptions) ([]*github.User, error)

ListTeamMembersBySlug provides a mock function for the type MockGitHubClient

func (*MockGitHubClient) ListUserKeys

func (_mock *MockGitHubClient) ListUserKeys(ctx context.Context, username string) ([]*github.Key, error)

ListUserKeys provides a mock function for the type MockGitHubClient

type MockGitHubClient_Expecter

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

func (*MockGitHubClient_Expecter) ListTeamMembersBySlug

func (_e *MockGitHubClient_Expecter) ListTeamMembersBySlug(ctx interface{}, org interface{}, teamSlug interface{}, opts interface{}) *MockGitHubClient_ListTeamMembersBySlug_Call

ListTeamMembersBySlug is a helper method to define mock.On call

  • ctx context.Context
  • org string
  • teamSlug string
  • opts *github.TeamListTeamMembersOptions

func (*MockGitHubClient_Expecter) ListUserKeys

func (_e *MockGitHubClient_Expecter) ListUserKeys(ctx interface{}, username interface{}) *MockGitHubClient_ListUserKeys_Call

ListUserKeys is a helper method to define mock.On call

  • ctx context.Context
  • username string

type MockGitHubClient_ListTeamMembersBySlug_Call

type MockGitHubClient_ListTeamMembersBySlug_Call struct {
	*mock.Call
}

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

func (*MockGitHubClient_ListTeamMembersBySlug_Call) Return

func (*MockGitHubClient_ListTeamMembersBySlug_Call) Run

func (*MockGitHubClient_ListTeamMembersBySlug_Call) RunAndReturn

type MockGitHubClient_ListUserKeys_Call

type MockGitHubClient_ListUserKeys_Call struct {
	*mock.Call
}

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

func (*MockGitHubClient_ListUserKeys_Call) Return

func (*MockGitHubClient_ListUserKeys_Call) Run

func (*MockGitHubClient_ListUserKeys_Call) RunAndReturn

type RealGitHubClient

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

func NewGitHubClient

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

NewGitHubClient creates a new RealGitHubClient with the provided OAuth token.

func (*RealGitHubClient) ListTeamMembersBySlug

func (c *RealGitHubClient) ListTeamMembersBySlug(ctx context.Context, org, teamSlug string, opts *github.TeamListTeamMembersOptions) ([]*github.User, error)

ListTeamMembersBySlug lists the members of a GitHub team identified by its slug.

func (*RealGitHubClient) ListUserKeys

func (c *RealGitHubClient) ListUserKeys(ctx context.Context, username string) ([]*github.Key, error)

ListUserKeys lists the public SSH keys of a GitHub user.

Jump to

Keyboard shortcuts

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