server

package
v0.0.0-...-b224b64 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthService

type AuthService interface {
	Authenticate(username, password string) (session string, err error)
	Validate(session string) error
	SetConnection(host string) error
}

AuthService is an interface to meet the authentication needs

type QueueService

type QueueService interface {
	Submit(ctx context.Context, session string, url string, depth int, job string) error
	SetConnection(host string) error
}

QueueService is an interface to meet the queue needs

type Server

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

Server satisfies gRPC service interface requirements API

func New

func New(authService AuthService, queueService QueueService, storeService StoreService) *Server

New creates a gRPC server instance for API

func (*Server) Authenticate

func (s *Server) Authenticate(ctx context.Context, ar *apipb.APIAuthenticateRequest) (*apipb.APIAuthenticateReply, error)

func (*Server) Get

func (s *Server) Get(ctx context.Context, ar *apipb.APIGetRequest) (*apipb.APIGetReply, error)

func (*Server) Serve

func (s *Server) Serve(address string) error

Serve handles gRPC requests for service API

func (*Server) Submit

func (s *Server) Submit(ctx context.Context, ar *apipb.APISubmitRequest) (*apipb.APISubmitReply, error)

Submit handles client requests to Submit to the API service

func (*Server) Validate

func (s *Server) Validate(ctx context.Context, ar *apipb.APIValidateRequest) (*apipb.APIValidateReply, error)

type StoreService

type StoreService interface {
	Get(ctx context.Context, session string, url string) (urls []string, err error)
	SetConnection(host string) error
}

StoreService is an interface to meet the store needs

Jump to

Keyboard shortcuts

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