luci: go.chromium.org/luci/auth/integration/devshell Index | Files

package devshell

import "go.chromium.org/luci/auth/integration/devshell"

Package devshell implements Devshell protocol for locally getting auth token.

Some Google Cloud tools know how to use it for authentication.

Index

Package Files

server.go

Constants

const EnvKey = "DEVSHELL_CLIENT_PORT"

EnvKey is the name of the environment variable which contains the Devshell server port number which is picked up by Devshell clients.

type Server Uses

type Server struct {
    // Source is used to obtain OAuth2 tokens.
    Source oauth2.TokenSource
    // Email is the email associated with the token.
    Email string
    // Port is a local TCP port to bind to or 0 to allow the OS to pick one.
    Port int
    // contains filtered or unexported fields
}

Server runs a Devshell server.

func (*Server) Start Uses

func (s *Server) Start(ctx context.Context) (*net.TCPAddr, error)

Start launches background goroutine with the serving loop.

The provided context is used as base context for request handlers and for logging.

The server must be eventually stopped with Stop().

func (*Server) Stop Uses

func (s *Server) Stop(ctx context.Context) error

Stop closes the listening socket, notifies pending requests to abort and stops the internal serving goroutine.

Safe to call multiple times. Once stopped, the server cannot be started again (make a new instance of Server instead).

Uses the given context for the deadline when waiting for the serving loop to stop.

Package devshell imports 14 packages (graph) and is imported by 3 packages. Updated 2018-12-18. Refresh now. Tools for package owners.