ctx

package
v0.0.0-...-2443087 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: BSD-3-Clause Imports: 9 Imported by: 1

Documentation

Overview

ctx is magic; it is basically my own "context" package before I realized that "context" existed. ctx.Context is the main construct. It keeps track of information pertinent to the request. It should all eventually be replaced by context.Context from the Go stdlib.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GitHubToken

func GitHubToken() string

func NewClient

func NewClient() *github.Client

func NewRubyGemsClient

func NewRubyGemsClient() *rubyGemsClient

func NewStatsd

func NewStatsd() *statsd.Client

Types

type Context

type Context struct {
	GitHub   *github.Client
	Statsd   *statsd.Client
	RubyGems *rubyGemsClient
	Repo     repoRef
	Issue    issueRef
	// contains filtered or unexported fields
}

func NewDefaultContext

func NewDefaultContext() *Context

func WithIssue

func WithIssue(owner, repo string, num int) *Context

func WithRepo

func WithRepo(owner, repo string) *Context

func (*Context) Context

func (c *Context) Context() gocontext.Context

func (*Context) CountStat

func (c *Context) CountStat(name string, value int64, tags []string)

func (*Context) CurrentlyAuthedGitHubUser

func (c *Context) CurrentlyAuthedGitHubUser() *github.User

func (*Context) GitHubAuthedAs

func (c *Context) GitHubAuthedAs(login string) bool

func (*Context) IncrStat

func (c *Context) IncrStat(name string, tags []string)

func (*Context) Log

func (c *Context) Log(format string, args ...interface{})

func (*Context) NewError

func (c *Context) NewError(format string, args ...interface{}) error

func (*Context) SetAuthor

func (c *Context) SetAuthor(author string)

func (*Context) SetIssue

func (c *Context) SetIssue(owner, repo string, num int)

func (*Context) SetRepo

func (c *Context) SetRepo(owner, repo string)

Jump to

Keyboard shortcuts

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