api

package
v0.0.0-...-7354109 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func NewLoggingServerHooks

func NewLoggingServerHooks() *twirp.ServerHooks

Types

type APIHTTPServer

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

func NewAPIHTTPServer

func NewAPIHTTPServer(config Config, apiServer *Server) *APIHTTPServer

func (*APIHTTPServer) NewAPIHandler

func (a *APIHTTPServer) NewAPIHandler() http.Handler

func (*APIHTTPServer) Start

func (a *APIHTTPServer) Start() error

type Config

type Config struct {
	Port  string `yaml:"port"`
	Local bool   `yaml:"local"`
}

func NewConfig

func NewConfig(provider config.Provider) (config Config, err error)

type HTTPServer

type HTTPServer interface {
	Start() error
}

type Server

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

func NewAPIServer

func NewAPIServer(
	db db.Store,
	fileStore *store.Files,
	normalizer normalize.Normalizer,
	summarizer text.Summarizer,
) *Server

func (Server) Save

func (s Server) Save(ctx context.Context, content *genapi.Content) (*genapi.ContentID, error)

func (Server) Search

func (s Server) Search(ctx context.Context, query *genapi.Query) (*genapi.Results, error)

Jump to

Keyboard shortcuts

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