raw

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package raw provides a client for interacting with the GitHub raw file API

Index

Constants

This section is empty.

Variables

View Source
var GetRawReposContentsByOwnerByRepoByBranchByPath mock.EndpointPattern = mock.EndpointPattern{
	Pattern: "/{owner}/{repo}/refs/heads/{branch}/{path:.*}",
	Method:  "GET",
}
View Source
var GetRawReposContentsByOwnerByRepoByPath mock.EndpointPattern = mock.EndpointPattern{
	Pattern: "/{owner}/{repo}/HEAD/{path:.*}",
	Method:  "GET",
}
View Source
var GetRawReposContentsByOwnerByRepoBySHAByPath mock.EndpointPattern = mock.EndpointPattern{
	Pattern: "/{owner}/{repo}/{sha}/{path:.*}",
	Method:  "GET",
}
View Source
var GetRawReposContentsByOwnerByRepoByTagByPath mock.EndpointPattern = mock.EndpointPattern{
	Pattern: "/{owner}/{repo}/refs/tags/{tag}/{path:.*}",
	Method:  "GET",
}

Functions

This section is empty.

Types

type Client

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

Client is a client for interacting with the GitHub raw content API.

func NewClient

func NewClient(client *gogithub.Client, rawURL *url.URL) *Client

NewClient creates a new instance of the raw API Client with the provided GitHub client and provided URL.

func (*Client) GetRawContent

func (c *Client) GetRawContent(ctx context.Context, owner, repo, path string, opts *ContentOpts) (*http.Response, error)

GetRawContent fetches the raw content of a file from a GitHub repository.

func (*Client) URLFromOpts

func (c *Client) URLFromOpts(opts *ContentOpts, owner, repo, path string) string

type ContentOpts added in v0.6.0

type ContentOpts struct {
	Ref string
	SHA string
}

type GetRawClientFn

type GetRawClientFn func(context.Context) (*Client, error)

GetRawClientFn is a function type that returns a RawClient instance.

Jump to

Keyboard shortcuts

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