framework

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 7 Imported by: 1 module, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckRequest

type CheckRequest[S any, V any] struct {
	Source  S  `json:"source"`
	Version *V `json:"version"`
}

type Checker

type Checker[SourceType any, VersionType any] interface {
	Check(CheckRequest[SourceType, VersionType]) ([]VersionType, error)
}

type GetRequest

type GetRequest[S any, V any, P any] struct {
	Source  S `json:"source"`
	Version V `json:"version"`
	Params  P `json:"params"`
}

type Getter

type Getter[SourceType any, VersionType any, ParamsType any] interface {
	Get(baseDir string, request GetRequest[SourceType, VersionType, ParamsType]) (Response[VersionType], error)
}

type MetadataField

type MetadataField struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type PutRequest

type PutRequest[S any, P any] struct {
	Source S `json:"source"`
	Params P `json:"params"`
}

type Putter

type Putter[SourceType any, VersionType any, ParamsType any] interface {
	Put(baseDir string, request PutRequest[SourceType, ParamsType]) (Response[VersionType], error)
}

type ResourceType

type ResourceType[S any, V any, G any, P any] struct {
	// contains filtered or unexported fields
}

func NewResourceType

func NewResourceType[S any, V any, G any, P any](impl any, options ...ResourceTypeOption[S, V, G, P]) ResourceType[S, V, G, P]

func (ResourceType[SourceType, VersionType, GetParamsType, PutParamsType]) Run

func (r ResourceType[SourceType, VersionType, GetParamsType, PutParamsType]) Run(args ...string) error

type ResourceTypeOption

type ResourceTypeOption[SourceType any, VersionType any, GetParamsType any, PutParamsType any] func(r *ResourceType[SourceType, VersionType, GetParamsType, PutParamsType])

func WithStdin

func WithStdin[S any, V any, G any, P any](stdin io.Reader) ResourceTypeOption[S, V, G, P]

func WithStdout

func WithStdout[S any, V any, G any, P any](stdout io.Writer) ResourceTypeOption[S, V, G, P]

type Response

type Response[V any] struct {
	Version  V               `json:"version"`
	Metadata []MetadataField `json:"metadata"`
}

Jump to

Keyboard shortcuts

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