interfaces

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package interfaces provides interfaces for the frizbee package.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrReferenceSkipped is returned when the reference is skipped.
	ErrReferenceSkipped = errors.New("reference skipped")
)

Functions

This section is empty.

Types

type EntityRef added in v0.0.16

type EntityRef struct {
	Name   string `json:"name"`
	Ref    string `json:"ref"`
	Type   string `json:"type"`
	Tag    string `json:"tag"`
	Prefix string `json:"prefix"`
}

EntityRef represents an action reference.

type Parser added in v0.0.16

type Parser interface {
	SetCache(cache store.RefCacher)
	SetRegex(regex string)
	GetRegex() string
	Replace(ctx context.Context, matchedLine string, restIf REST, cfg config.Config) (*EntityRef, error)
	ConvertToEntityRef(reference string) (*EntityRef, error)
}

Parser is an interface to replace references with digests

type REST

type REST interface {
	// NewRequest creates an HTTP request.
	NewRequest(method, url string, body any) (*http.Request, error)
	// Do executes an HTTP request.
	Do(ctx context.Context, req *http.Request) (*http.Response, error)
}

The REST interface allows to wrap clients to talk to remotes When talking to GitHub, wrap a github client to provide this interface

Jump to

Keyboard shortcuts

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