service

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2018 License: Apache-2.0 Imports: 10 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = status.Errorf(codes.NotFound, "Service not found")
)

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
	SSLInfo(appName string) (*SSLInfo, error)
}

type FakeAppOperations

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

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
	SSLInfoErr           error
	SSLInfoValue         *SSLInfo
}

func (*FakeCloudProviderOperations) CreateOrUpdateSSL

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

func (*FakeCloudProviderOperations) SSLInfo

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

type FakeK8sOperations

type FakeK8sOperations struct {
	UpdateServicePortsErr error
	IsNotFoundErr         bool
	ServicePortsErr       error
	ServicePortsValue     []*spec.ServicePort
}

func (*FakeK8sOperations) IsNotFound

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

func (*FakeK8sOperations) ServicePorts

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

func (*FakeK8sOperations) UpdateServicePorts

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

type FakeOperations

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

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)

type Info

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

type K8sOperations

type K8sOperations interface {
	UpdateServicePorts(namespace, svcName string, ports []spec.ServicePort) error
	IsNotFound(err error) bool
	ServicePorts(namespace, svcName string) ([]*spec.ServicePort, error)
}

type Operations

type Operations interface {
	EnableSSL(user *database.User, appName, cert string, only bool) error
	Info(user *database.User, appName string) (*Info, 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)

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)

Jump to

Keyboard shortcuts

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