Documentation
¶
Index ¶
- Variables
- func AppName() string
- func CheckCanCustomize()
- func CheckLockedDown()
- func FilterSlice[E any, S ~[]E](s S, f func(E) bool) S
- func IsHTTPOk(r *http.Response) bool
- func IsNotFound(err error) bool
- func LockCustomizations()
- func Must[T any](v T, err error) T
- func Ptr[T any](t T) *T
- func ReadJSONFile[T any](name string) (T, error)
- func SetAppName(name string)
- func ValueOrDefault[T any](p *T, d T) T
- func ValueOrZero[T any](p *T) T
- func WithToken(token string) ghClientOpt
- type GitHubClient
- func (c *GitHubClient) Do(req *http.Request) (*http.Response, error)
- func (c *GitHubClient) DoAndParse(req *http.Request, respData any) error
- func (c *GitHubClient) Download(ctx context.Context, url string) (*http.Response, error)
- func (c *GitHubClient) Get(ctx context.Context, path string, respData any) error
- func (c *GitHubClient) Release(ctx context.Context, owner, repo, tag string) (*GitHubRelease, error)
- type GitHubRelease
- type GitHubReleaseAsset
- type HTTPError
- type NoCopy
- type StatusCodeErr
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTrailingGarbage = errors.New("trailing garbage in JSON file")
Functions ¶
func AppName ¶
func AppName() string
AppName is what the app will call itself. When customizing, overwrite it before calling Main().
func CheckCanCustomize ¶
func CheckCanCustomize()
func CheckLockedDown ¶
func CheckLockedDown()
func FilterSlice ¶
func IsNotFound ¶
func LockCustomizations ¶
func LockCustomizations()
func ReadJSONFile ¶
func SetAppName ¶
func SetAppName(name string)
func ValueOrDefault ¶
func ValueOrDefault[T any](p *T, d T) T
func ValueOrZero ¶
func ValueOrZero[T any](p *T) T
Types ¶
type GitHubClient ¶
type GitHubClient struct {
// contains filtered or unexported fields
}
GitHubClient provides a rudimentary client for acccessing GitHub resources over its REST api, without pulling in large dependencies.
func NewGitHubClient ¶
func NewGitHubClient(opts ...ghClientOpt) *GitHubClient
func (*GitHubClient) DoAndParse ¶
func (c *GitHubClient) DoAndParse(req *http.Request, respData any) error
func (*GitHubClient) Release ¶
func (c *GitHubClient) Release(ctx context.Context, owner, repo, tag string) (*GitHubRelease, error)
type GitHubRelease ¶
type GitHubRelease struct {
Assets []GitHubReleaseAsset `json:"assets"`
}
type GitHubReleaseAsset ¶
type HTTPError ¶
func (*HTTPError) StatusCode ¶
StatusCode implements internal.StatusCodeErr
type StatusCodeErr ¶
type StatusCodeErr interface {
StatusCode() int
}
Click to show internal directories.
Click to hide internal directories.