{"modulePath":"github.com/Excoriate/daggerx","version":"v0.0.36","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package githubx\n\nPackage githubx provides utilities for interacting with GitHub's API, specifically for fetching information about releases in a GitHub repository.\n\nThis package includes functionality to authenticate with GitHub using an OAuth2 token, and to retrieve the latest release information from a specified repository. It leverages the go-github library to interact with GitHub's API.\n\nExample usage:\n\n\timport (\n\t    \"fmt\"\n\t    \"github.com/yourusername/yourrepo/pkg/githubx\"\n\t)\n\n\tfunc main() {\n\t    client := githubx.NewGHClient(\"your-github-token\", \"owner\", \"repo\")\n\t    latestRelease, err := client.FetchLatestRelease()\n\t    if err != nil {\n\t        fmt.Println(\"Error fetching latest release:\", err)\n\t        return\n\t    }\n\t    fmt.Println(\"Latest release:\", latestRelease)\n\t}\n\nThe above example demonstrates how to create a new GHClient instance and fetch the latest release tag from a specified GitHub repository.\n\nNote: Ensure that you have a valid GitHub token with the necessary permissions to access the repository's release information.\n\nFor more details on GitHub's API, refer to the official documentation: [https://docs.github.com/en/rest/reference/repos#releases](https://docs.github.com/en/rest/reference/repos#releases)\n\n## Types\n\n```go\ntype Client struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (c *Client) GetOwner() string\n```\n\n```go\nfunc (c *Client) GetRepo() string\n```\n\n```go\nfunc (c *Client) GetToken() string\n```\n\n```go\ntype Config interface {\n\tGetToken() string\n\tGetOwner() string\n\tGetRepo() string\n}\n```\n\n```go\nfunc NewClientConfig(owner, repo, token string) Config\n```\n\n```go\ntype GHClient struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc New(cfg Config) *GHClient\n```\n\n```go\nfunc (gh *GHClient) FetchLatestRelease() (string, error)\n```\nFetchLatestRelease fetches the latest release from the GitHub repository.\n\nReturns:\n\n  - A string representing the latest release tag.\n  - An error if the latest release cannot be fetched.\n\n","path":"github.com/Excoriate/daggerx/pkg/githubx","name":"githubx","synopsis":"Package githubx provides utilities for interacting with GitHub's API, specifically for fetching information about releases in a GitHub repository.","isRedistributable":true}
