testing

package
v0.0.0-...-d246de9 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ValidClientAuthToken = "valid-client-auth-token"
)

Variables

View Source
var (
	TestTokenSource = oauth2.StaticTokenSource(&oauth2.Token{AccessToken: validServerAuthToken})
)

Functions

func TestRequestAuthorizer

func TestRequestAuthorizer(r *http.Request) error

Types

type GitRepo

type GitRepo string

func NewLocalBareGitRepo

func NewLocalBareGitRepo() GitRepo

func NewLocalGitRepo

func NewLocalGitRepo() GitRepo

func (GitRepo) Close

func (r GitRepo) Close() error

func (GitRepo) CreateRandomCommit

func (r GitRepo) CreateRandomCommit() (string, error)

func (GitRepo) Run

func (r GitRepo) Run(arg ...string) (string, error)

type TestServer

type TestServer struct {
	UpstreamGitRepo GitRepo

	UpstreamServerURL string

	ProxyServerURL string
	// contains filtered or unexported fields
}

func NewTestServer

func NewTestServer(config *TestServerConfig) *TestServer

func (*TestServer) Close

func (s *TestServer) Close()

func (*TestServer) CreateRandomCommitUpstream

func (s *TestServer) CreateRandomCommitUpstream() (string, error)

type TestServerConfig

type TestServerConfig struct {
	RequestAuthorizer func(r *http.Request) error
	TokenSource       oauth2.TokenSource
	ErrorReporter     func(*http.Request, error)
	RequestLogger     func(r *http.Request, status int, requestSize, responseSize int64, latency time.Duration)
}

Jump to

Keyboard shortcuts

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