server

package
v0.0.0-...-51b19de Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: BSD-2-Clause-Views Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const RequestTimeout = 30 * time.Second

Variables

View Source
var (
	ErrTimedOut = errors.New("timed out talking to backend")
)

Functions

func New

func New(cfg *config.Config) (http.Handler, error)

func ParseQuery

func ParseQuery(query string, globalRegex bool) (pb.Query, error)

Types

type Availability

type Availability struct {
	IsUp      bool
	DownSince time.Time
	DownCode  codes.Code
	sync.Mutex
}

type Backend

type Backend struct {
	Id            string
	Addr          string
	I             *I
	Codesearch    pb.CodeSearchClient
	GrpcClient    *grpc.ClientConn
	Up            *Availability
	BackupBackend *Backend
	IsBackup      bool
}

func NewBackend

func NewBackend(be config.Backend) (*Backend, error)

NewBackend can now be recursively called since BackupBackend can be nested...

func (*Backend) Start

func (bk *Backend) Start()

type BackendStatus

type BackendStatus struct {
	GrpcStatus   connectivity.State `json:"grpc_status"`
	IndexAge     string             `json:"index_age"`
	IndexName    string             `json:"index_name"`
	Up           *Availability      `json:"up"`
	BuGrpcStatus connectivity.State `json:"bu_grpc_status"`
	BuIndexAge   string             `json:"bu_index_age"`
	BuIndexName  string             `json:"bu_index_name"`
	BuUp         *Availability      `json:"bu_up"`
}

type I

type I struct {
	Name  string
	Trees []Tree
	sync.Mutex
	IndexTime time.Time
}

type Tree

type Tree struct {
	Name    string
	Version string
	Url     string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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