assethook

package
v0.0.0-...-3792b5d Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewValidator

func NewValidator(httpClient HttpClient, timeout time.Duration, workers int) *validationEngine

Types

type Config

type Config struct {
	MutationWorkersCount      int           `envconfig:"default=10"`
	MutationTimeout           time.Duration `envconfig:"default=1m"`
	ValidationWorkersCount    int           `envconfig:"default=10"`
	ValidationTimeout         time.Duration `envconfig:"default=1m"`
	MetadataExtractionTimeout time.Duration `envconfig:"default=1m"`
}

type File

type File struct {
	Name     string
	Metadata *json.RawMessage
}

type HttpClient

type HttpClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type Message

type Message struct {
	Filename string
	Message  string
}

type MetadataExtractor

type MetadataExtractor interface {
	Extract(ctx context.Context, basePath string, files []string, services []v1alpha2.WebhookService) ([]File, error)
}

func NewMetadataExtractor

func NewMetadataExtractor(httpClient HttpClient, timeout time.Duration) MetadataExtractor

type Mutator

type Mutator interface {
	Mutate(ctx context.Context, basePath string, files []string, services []v1alpha2.AssetWebhookService) (Result, error)
}

func NewMutator

func NewMutator(httpClient HttpClient, timeout time.Duration, workers int) Mutator

type Result

type Result struct {
	Success  bool
	Messages map[string][]Message
}

type Validator

type Validator interface {
	Validate(ctx context.Context, basePath string, files []string, services []v1alpha2.AssetWebhookService) (Result, error)
}

Directories

Path Synopsis
api
Code generated by mockery v1.0.0
Code generated by mockery v1.0.0

Jump to

Keyboard shortcuts

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