Back to

Package creator

Latest Go to latest

The highest tagged major version is .

Published: Jun 30, 2019 | License: Apache-2.0 | Module:



const (
	ServiceNameMinimumLength    = 1
	ServiceNameMaximumLength    = 24
	ServiceNameExpr             = schema.ResourceNameSchemaPattern
	EC2ComputeNameMaximumLength = ec2compute_v2.MaximumServiceNameLength


var (
	ServiceNameRegExp    = regexp.MustCompile(ServiceNameExpr)
	ServiceGroupResource = creator_v1.Resource(creator_v1.ServiceResourceSingular)

func IsBlackListError

func IsBlackListError(e error) bool

IsBlackListError checks if 'e' is a BlackListError. Returns true when it is a BlackListError and is not nil.

func NewBlackListError

func NewBlackListError(blackListedClass string, blackListedInstance string) error

NewBlackListError creates a BlackListError. blackListedClass is the the type of thing that is blacklisted, like a name or URL, and blackListedInstance is the actual instance that was inputted, like the name "voyager" or the URL "".

type BlackListError

type BlackListError struct {
	// contains filtered or unexported fields

lackListError is for cases where a particular input has been reserved.

func (*BlackListError) Error

func (e *BlackListError) Error() string

Error is to implement the 'error' interface.

type ExtraConfig

type ExtraConfig struct {
	Logger            *zap.Logger
	SSAMURL           *url.URL
	ServiceCentralURL *url.URL
	LuigiURL          *url.URL
	PagerDuty         pagerduty.ClientConfig
	ASAPClientConfig  pkiutil.ASAP
	HTTPClient        *http.Client

type LuigiClientInterface

type LuigiClientInterface interface {
	FindOrCreateService(ctx context.Context, meta *luigi.ServiceMetadata) (*luigi.BasicServiceData, error)
	DeleteService(ctx context.Context, loggingID string) error

type PagerDutyClientInterface

type PagerDutyClientInterface interface {
	FindOrCreate(serviceName voyager.ServiceName, user auth.User, email string) (creator_v1.PagerDutyMetadata, error)
	Delete(serviceName voyager.ServiceName) error

type SSAMClientInterface

type SSAMClientInterface interface {
	GetExpectedServiceContainerName(ctx context.Context, metadata *ssam.ServiceMetadata) string
	CreateService(ctx context.Context, metadata *ssam.ServiceMetadata) (string, ssam.AccessLevels, error)
	DeleteService(ctx context.Context, metadata *ssam.ServiceMetadata) error

type ServiceCentralStoreInterface

type ServiceCentralStoreInterface interface {
	FindOrCreateService(ctx context.Context, user auth.User, service *creator_v1.Service) (*creator_v1.Service, error)
	GetService(ctx context.Context, user auth.OptionalUser, name servicecentral.ServiceName) (*creator_v1.Service, error)
	ListServices(ctx context.Context, user auth.OptionalUser) ([]creator_v1.Service, error)
	ListModifiedServices(ctx context.Context, user auth.OptionalUser, modifiedSince time.Time) ([]creator_v1.Service, error)
	PatchService(ctx context.Context, user auth.User, service *creator_v1.Service) error
	DeleteService(ctx context.Context, user auth.User, name servicecentral.ServiceName) error

type ServiceHandler

type ServiceHandler struct {
	// contains filtered or unexported fields

func NewHandler

func NewHandler(config *ExtraConfig) (*ServiceHandler, error)

func (*ServiceHandler) ServiceCreate

func (h *ServiceHandler) ServiceCreate(ctx context.Context, service *creator_v1.Service) (*creator_v1.Service, error)

func (*ServiceHandler) ServiceDelete

func (h *ServiceHandler) ServiceDelete(ctx context.Context, name voyager.ServiceName) (*creator_v1.Service, error)

func (*ServiceHandler) ServiceGet

func (h *ServiceHandler) ServiceGet(ctx context.Context, name voyager.ServiceName) (*creator_v1.Service, error)

func (*ServiceHandler) ServiceList

func (h *ServiceHandler) ServiceList(w http.ResponseWriter, r *http.Request)

func (*ServiceHandler) ServiceListNew

func (h *ServiceHandler) ServiceListNew(ctx context.Context) (*creator_v1.ServiceList, error)

func (*ServiceHandler) ServiceUpdate

func (h *ServiceHandler) ServiceUpdate(ctx context.Context, name voyager.ServiceName, objInfo rest.UpdatedObjectInfo) (*creator_v1.Service, error)

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier