rpc

package
v0.0.0-...-a4a700b Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2016 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewIngesterClient

func NewIngesterClient(addr string, token string) (pb.IngesterClient, error)

NewIngesterClient gets an ingester client for a given address

func TokenFromContext

func TokenFromContext(ctx context.Context) (token string, ok bool)

TokenFromContext retrieves a token from a context

Types

type Server

type Server struct {
	Auth map[string]string

	DatabaseAddr     string
	DatabaseUsername string
	DatabasePassword string
	DatabaseName     string
}

Server handles authentication and serves

func (*Server) Listen

func (s *Server) Listen(ctx context.Context, addr string) error

Listen on the given address for all the server-y duties

type TokenAuthenticator

type TokenAuthenticator string

TokenAuthenticator is for use on a client to provide a token

func NewTokenAuthenticator

func NewTokenAuthenticator(token string) TokenAuthenticator

NewTokenAuthenticator creates a new authentic

func (TokenAuthenticator) GetRequestMetadata

func (a TokenAuthenticator) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error)

GetRequestMetadata gets header data for a given request

func (TokenAuthenticator) RequireTransportSecurity

func (TokenAuthenticator) RequireTransportSecurity() bool

RequireTransportSecurity should be true, but isn't

type TokenVerifier

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

TokenVerifier verifies tokens against a collection of tokens

func NewTokenVerifier

func NewTokenVerifier(tokens map[string]string) *TokenVerifier

NewTokenVerifier creates a verifier from a map of tokens to their projects

func (*TokenVerifier) VerifyForProject

func (t *TokenVerifier) VerifyForProject(token, project string) error

VerifyForProject verifies that a token is valid for a given project

func (*TokenVerifier) VerifyForProjectInContext

func (t *TokenVerifier) VerifyForProjectInContext(ctx context.Context, project string) error

VerifyForProjectInContext does VerifyForProject in a context

Directories

Path Synopsis
Package pb is a generated protocol buffer package.
Package pb is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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