lib

package
v0.1.10 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckClose added in v0.1.8

func CheckClose(v interface{})

CheckClose safe closing for defer

func FindFiles added in v0.0.43

func FindFiles(fs FileSystem, root string, re string) ([]string, error)

FindFiles - Recursively search for files matching a pattern.

func SummaryBuilder added in v0.0.75

func SummaryBuilder(conftestResults ConftestResults) (string, string)

SummaryBuilder - Builds the summary for the check run.

func UnZip added in v0.0.38

func UnZip(source string, destination string) error

UnZip - Extracts a zip archive

Types

type ConftestResults added in v0.0.74

type ConftestResults []struct {
	Filename  string `json:"filename"`
	Successes int    `json:"successes,omitempty"`
	Failures  []struct {
		Msg      string `json:"msg"`
		Metadata struct {
			// contains filtered or unexported fields
		} `json:"metadata,omitempty"`
	} `json:"failures,omitempty"`
	Warnings []struct {
		Msg      string `json:"msg"`
		Metadata struct {
			// contains filtered or unexported fields
		} `json:"metadata,omitempty"`
	} `json:"warnings,omitempty"`
}

ConftestResults - Holds conftest results

func Scan added in v0.0.68

func Scan(fs FileSystem, rootPath string, policyID string, files []string) ConftestResults

Scan - Use conftest to Scan discovered files.

type File added in v0.1.1

type File interface {
	io.Closer
	io.Writer
	io.Reader
	io.ReaderAt
	io.Seeker
	Stat() (os.FileInfo, error)
}

File interface

type FileSystem added in v0.1.2

type FileSystem interface {
	Open(name string) (File, error)
	Copy(dst io.Writer, src io.Reader) (int64, error)
	Create(name string) (File, error)
	Remove(name string) error
	RemoveAll(name string) error
	Stat(name string) (os.FileInfo, error)
	Walk(root string, walkFn filepath.WalkFunc) error
	ReadFile(filename string) ([]byte, error)
	WriteFile(filename string, data []byte, perm os.FileMode) error
	NewFile(fd uintptr, name string) File
}

FileSystem - Interface

type HTTPClient added in v0.1.7

type HTTPClient struct {
	Client *http.Client
	URL    string
}

HTTPClient - HTTP Client

func NewHTTPClient added in v0.1.7

func NewHTTPClient(http *http.Client, url string) *HTTPClient

NewHTTPClient - Returns new HTTPClient

func (*HTTPClient) DownloadFile added in v0.1.7

func (c *HTTPClient) DownloadFile(fs FileSystem) (string, error)

DownloadFile - Download a file from a URL

type OSFS added in v0.0.38

type OSFS struct{}

OSFS implements fileSystem using the local disk.

func (OSFS) Copy added in v0.0.38

func (OSFS) Copy(dst io.Writer, src io.Reader) (int64, error)

Copy - Copy File

func (OSFS) Create added in v0.0.38

func (OSFS) Create(name string) (File, error)

Create - Create File

func (OSFS) NewFile added in v0.1.7

func (OSFS) NewFile(fd uintptr, name string) File

NewFile - Creates a new File

func (OSFS) Open added in v0.0.38

func (OSFS) Open(name string) (File, error)

Open - Open File

func (OSFS) ReadFile added in v0.0.38

func (OSFS) ReadFile(filename string) ([]byte, error)

ReadFile - Reads a File

func (OSFS) Remove added in v0.1.2

func (OSFS) Remove(name string) error

Remove - Remove File

func (OSFS) RemoveAll added in v0.1.4

func (OSFS) RemoveAll(name string) error

RemoveAll - Remove Directory

func (OSFS) Stat added in v0.0.38

func (OSFS) Stat(name string) (os.FileInfo, error)

Stat - Stat File

func (OSFS) Walk added in v0.0.38

func (OSFS) Walk(root string, walkFn filepath.WalkFunc) error

Walk - Walk Path

func (OSFS) WriteFile added in v0.0.38

func (OSFS) WriteFile(filename string, data []byte, perm os.FileMode) error

WriteFile - Writes to a File

Jump to

Keyboard shortcuts

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