mock

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package mock provides mock servers for testing the GitHub client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReleaseResponse

type ReleaseResponse struct {
	TagName string `json:"tag_name"`
}

ReleaseResponse represents a release from the GitHub API.

type Server

type Server struct {
	HTTPServer *httptest.Server
	// contains filtered or unexported fields
}

Server provides a mock GitHub API server for testing.

func NewServer

func NewServer() *Server

NewServer creates a new mock GitHub API server.

func (*Server) AddReleases

func (s *Server) AddReleases(owner, repo string, releases []string)

AddReleases adds releases for a repository.

func (*Server) AddTags

func (s *Server) AddTags(owner, repo string, tags []string)

AddTags adds tags for a repository.

func (*Server) Close

func (s *Server) Close()

Close shuts down the mock server.

func (*Server) URL

func (s *Server) URL() string

URL returns the base URL of the mock server.

type TagResponse

type TagResponse struct {
	Ref string `json:"ref"`
}

TagResponse represents a tag from the GitHub API.

Jump to

Keyboard shortcuts

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