workloadhandler

package
v0.0.0-...-730bba4 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidConnection define the invalide connection
	ErrInvalidConnection = errors.New("invalid connection")

	// ErrNoCredentials define no creds
	ErrNoCredentials = errors.New("no credentials available")
)

Functions

func NewServer

func NewServer(wli *pbmgmt.WorkloadInfo, wlS *mwi.WlServer, pathPrefix string) mwi.WorkloadMgmtInterface

NewServer return the new server with default setup

Types

type CredInfo

type CredInfo struct {
	UID            string
	Name           string
	Namespace      string
	ServiceAccount string
	Err            error
}

CredInfo returned by grpc Credential that the workload API can use.

func CallerFromAuthInfo

func CallerFromAuthInfo(ainfo credentials.AuthInfo) (CredInfo, bool)

CallerFromAuthInfo return the auth info

func CallerFromContext

func CallerFromContext(ctx context.Context) (CredInfo, bool)

CallerFromContext return the caller info

func NewCreds

func NewCreds(wli *pbmgmt.WorkloadInfo) *CredInfo

NewCreds return the new creds

func (CredInfo) AuthType

func (c CredInfo) AuthType() string

AuthType return the auth type

type Server

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

Server is the WorkloadHandler (one per workload).

func (*Server) ClientHandshake

func (s *Server) ClientHandshake(_ context.Context, _ string, conn net.Conn) (net.Conn, credentials.AuthInfo, error)

ClientHandshake return the client handshake info

func (*Server) Clone

Clone return the clone info

func (*Server) GetCred

GetCred get the cred

func (*Server) Info

func (s *Server) Info() credentials.ProtocolInfo

Info return the proto info

func (*Server) OverrideServerName

func (s *Server) OverrideServerName(_ string) error

OverrideServerName override server name

func (*Server) Serve

func (s *Server) Serve()

Serve adherence to nodeagent workload management interface.

func (*Server) ServerHandshake

func (s *Server) ServerHandshake(conn net.Conn) (net.Conn, credentials.AuthInfo, error)

ServerHandshake return the server handshake info

func (*Server) Stop

func (s *Server) Stop()

Stop tell the server it should stop

func (*Server) WaitDone

func (s *Server) WaitDone()

WaitDone for the server to stop and then return

Jump to

Keyboard shortcuts

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