github

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package github は go-github を薄くラップし、ghs から必要な操作のみを公開します。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client は GitHub API クライアントのラッパーです。

func New

func New(ctx context.Context, token string) *Client

New は OAuth2 トークンで認証された Client を返します。

func (*Client) CurrentUser

func (c *Client) CurrentUser(ctx context.Context) (string, error)

CurrentUser は認証済みユーザーの login (username) を返します。

func (*Client) ListOwners

func (c *Client) ListOwners(ctx context.Context) ([]string, error)

ListOwners は自分のユーザー名と、所属しているすべての組織のスラッグをまとめて返します。 先頭は必ず認証ユーザー自身です。

func (*Client) ListRepositories

func (c *Client) ListRepositories(ctx context.Context, owner string) ([]Repository, error)

ListRepositories は指定オーナーのリポジトリ一覧を取得します。 owner が認証ユーザー自身の場合は private 含む全件、それ以外(組織)も同様に取得を試みます。

type Repository

type Repository struct {
	Owner       string
	Name        string
	FullName    string
	Description string
	Private     bool
	Fork        bool
	Archived    bool
	HTMLURL     string
	SSHURL      string
	CloneURL    string
}

Repository は UI 側で扱いやすいよう必要な情報だけを抽出した構造体です。

Jump to

Keyboard shortcuts

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