api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2021 License: AGPL-3.0 Imports: 29 Imported by: 0

Documentation

Overview

Copyright © 2020 Yale University

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(config common.Config) error

NewServer creates a new server and starts it

func TokenMiddleware

func TokenMiddleware(psk []byte, public map[string]string, h http.Handler) http.Handler

TokenMiddleware checks the tokens for non-public URLs

Types

type LogWriter

type LogWriter struct {
	http.ResponseWriter
}

LogWriter is an http.ResponseWriter

func (LogWriter) Write

func (w LogWriter) Write(p []byte) (n int, err error)

Write log message if http response writer returns an error

type RepositoryCreateRequest

type RepositoryCreateRequest struct {
	// Specify a custom KmsKeyId.  This will also change the encryption type from
	// 'AES256' to 'KMS'.  By default, when no encryption configuration is set or
	// the AES256 encryption type is used, Amazon ECR uses server-side encryption
	// with Amazon S3-managed encryption keys which encrypts your data at rest using
	// an AES-256 encryption algorithm.
	// Note: AWS KMS enforces a limit of 500 grants per CMK. As a result, there is
	// a limit of 500 Amazon ECR repositories that can be encrypted per CMK.
	KmsKeyId string

	// The setting that determines whether images are scanned after being pushed
	// to a repository. If set to true, images will be scanned after being pushed.
	// If this parameter is not specified, it will default to false and images will
	// not be scanned unless a scan is manually started with the StartImageScan
	// API.
	ScanOnPush string

	// The name to use for the repository. The repository name may be specified
	// on its own (such as nginx-web-app) or it can be prepended with a namespace
	// to group the repository into a category (such as project-a/nginx-web-app)
	RepositoryName string

	// Tags to apply to the repository
	Tags []*Tag
}

RepositoryCreateRequest is the payload for creating an ECR repository

type RepositoryResponse

type RepositoryResponse struct {
	CreatedAt          time.Time
	EncryptionType     string
	KmsKeyId           string
	ScanOnPush         string
	ImageTagMutability string
	RegistryId         string
	RepositoryArn      string
	RepositoryName     string
	RepositoryUri      string
	Tags               []*Tag
}

RepositoryResponse is the response payload for repository operations

type RepositoryUpdateRequest

type RepositoryUpdateRequest struct {
	ScanOnPush string
	Tags       []*Tag
}

RepositoryUpdateRequest is the payload for updating an ECR repository

type Tag

type Tag struct {
	Key   string
	Value string
}

Tag is our AWS compatible tag struct that can be converted to specific tag types

Jump to

Keyboard shortcuts

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