service

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound               = status.Errorf(codes.NotFound, "Service not found")
	ErrInvalidSourceRanges    = status.Errorf(codes.InvalidArgument, "Invalid source ranges")
	ErrWhitelistUnimplemented = status.Errorf(codes.Unimplemented, "Whitelist not supported for ingress or internal apps")
)

Functions

This section is empty.

Types

type AppOperations

type AppOperations interface {
	HasPermission(user *database.User, appName string) bool
	CheckPermAndGet(user *database.User, appName string) (*app.App, error)
}

type CloudProviderOperations

type CloudProviderOperations interface {
	CreateOrUpdateSSL(appName, cert string, port int) error
	CreateOrUpdateStaticIp(appName, addressName string) error
	SSLInfo(appName string) (*SSLInfo, error)
}

type FakeAppOperations

type FakeAppOperations struct {
	NegateHasPermission bool
	App                 *app.App
	CheckPermAndGetErr  error
}

func (*FakeAppOperations) CheckPermAndGet added in v0.20.0

func (f *FakeAppOperations) CheckPermAndGet(user *database.User, appName string) (*app.App, error)

func (*FakeAppOperations) HasPermission

func (f *FakeAppOperations) HasPermission(user *database.User, appName string) bool

type FakeCloudProviderOperations

type FakeCloudProviderOperations struct {
	CreateOrUpdateSSLErr      error
	CreateOrUpdateStaticIpErr error
	SSLInfoErr                error
	SSLInfoValue              *SSLInfo
}

func (*FakeCloudProviderOperations) CreateOrUpdateSSL

func (f *FakeCloudProviderOperations) CreateOrUpdateSSL(appName, cert string, port int) error

func (*FakeCloudProviderOperations) CreateOrUpdateStaticIp added in v0.30.0

func (f *FakeCloudProviderOperations) CreateOrUpdateStaticIp(appName, addressName string) error

func (*FakeCloudProviderOperations) SSLInfo

func (f *FakeCloudProviderOperations) SSLInfo(appName string) (*SSLInfo, error)

type FakeK8sOperations

type FakeK8sOperations struct {
	UpdateServicePortsErr          error
	IsNotFoundErr                  bool
	ServiceErr                     error
	ServiceValue                   *spec.Service
	SetLoadBalancerSourceRangesErr error
	IsInvalidErr                   bool
	HasIngressValue                bool
	HasIngressErr                  error
}

func (*FakeK8sOperations) HasIngress added in v0.26.0

func (f *FakeK8sOperations) HasIngress(namespace, name string) (bool, error)

func (*FakeK8sOperations) IsInvalid added in v0.24.0

func (f *FakeK8sOperations) IsInvalid(err error) bool

func (*FakeK8sOperations) IsNotFound

func (f *FakeK8sOperations) IsNotFound(err error) bool

func (*FakeK8sOperations) Service added in v0.24.0

func (f *FakeK8sOperations) Service(namespace, svcName string) (*spec.Service, error)

func (*FakeK8sOperations) SetLoadBalancerSourceRanges added in v0.24.0

func (f *FakeK8sOperations) SetLoadBalancerSourceRanges(namespace, svcName string, sourceRanges []string) error

func (*FakeK8sOperations) UpdateServicePorts

func (f *FakeK8sOperations) UpdateServicePorts(namespace, svcName string, ports []spec.ServicePort) error

type FakeOperations

type FakeOperations struct {
	EnableSSLErr             error
	SetStaticIpErr           error
	InfoErr                  error
	InfoValue                *Info
	WhitelistSourceRangesErr error
}

func (*FakeOperations) EnableSSL

func (f *FakeOperations) EnableSSL(user *database.User, appName, cert string, only bool) error

func (*FakeOperations) Info

func (f *FakeOperations) Info(user *database.User, appName string) (*Info, error)

func (*FakeOperations) SetStaticIp added in v0.30.0

func (f *FakeOperations) SetStaticIp(user *database.User, appName, addressName string) error

func (*FakeOperations) WhitelistSourceRanges added in v0.24.0

func (f *FakeOperations) WhitelistSourceRanges(user *database.User, appName string, sourceRanges []string) error

type Info

type Info struct {
	ServicePorts []spec.ServicePort
	SSLInfo      *SSLInfo
	SourceRanges []string
}

type K8sOperations

type K8sOperations interface {
	UpdateServicePorts(namespace, svcName string, ports []spec.ServicePort) error
	IsNotFound(err error) bool
	IsInvalid(err error) bool
	Service(namespace, svcName string) (*spec.Service, error)
	SetLoadBalancerSourceRanges(namespace, svcName string, sourceRanges []string) error
	HasIngress(namespace, name string) (bool, error)
}

type Operations

type Operations interface {
	EnableSSL(user *database.User, appName, cert string, only bool) error
	SetStaticIp(user *database.User, appName, addressName string) error
	Info(user *database.User, appName string) (*Info, error)
	WhitelistSourceRanges(user *database.User, appName string, sourceRanges []string) error
}

type SSLInfo

type SSLInfo struct {
	ServicePort *spec.ServicePort
	Cert        string
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(ops Operations) *Service

func (*Service) EnableSSL

func (svc *Service) EnableSSL(ctx context.Context, req *svcpb.EnableSSLRequest) (*svcpb.Empty, error)

func (*Service) Info

func (svc *Service) Info(ctx context.Context, req *svcpb.InfoRequest) (*svcpb.InfoResponse, error)

func (*Service) RegisterService

func (svc *Service) RegisterService(grpcServer *grpc.Server)

func (*Service) SetStaticIp added in v0.30.0

func (svc *Service) SetStaticIp(ctx context.Context, req *svcpb.SetStaticIpRequest) (*svcpb.Empty, error)

func (*Service) WhitelistSourceRanges added in v0.24.0

func (svc *Service) WhitelistSourceRanges(ctx context.Context, req *svcpb.WhitelistSourceRangesRequest) (*svcpb.Empty, error)

type ServiceOperations

type ServiceOperations struct {
	// contains filtered or unexported fields
}

func (*ServiceOperations) EnableSSL

func (ops *ServiceOperations) EnableSSL(user *database.User, appName, cert string, only bool) error

func (*ServiceOperations) Info

func (ops *ServiceOperations) Info(user *database.User, appName string) (*Info, error)

func (*ServiceOperations) SetStaticIp added in v0.30.0

func (ops *ServiceOperations) SetStaticIp(user *database.User, appName, addressName string) error

func (*ServiceOperations) WhitelistSourceRanges added in v0.24.0

func (ops *ServiceOperations) WhitelistSourceRanges(user *database.User, appName string, sourceRanges []string) error

Jump to

Keyboard shortcuts

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