Help us shape the future of Go! Take the 2026 Go Developer Survey

server

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CatalogHandlers

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

CatalogHandlers handles HTTP requests for catalog content

func NewCatalogHandlers

func NewCatalogHandlers(store CatalogStore, graphqlSvc service.GraphQLService, rootURL *url.URL, enableMetas MetasHandlerMode, enableGraphQL GraphQLQueriesMode) *CatalogHandlers

NewCatalogHandlers creates a new HTTP handlers instance

func (*CatalogHandlers) Handler

func (h *CatalogHandlers) Handler() http.Handler

Handler returns an HTTP handler with all routes configured

type CatalogStore

type CatalogStore interface {
	// GetCatalogData returns the catalog file and its metadata
	GetCatalogData(catalog string) (*os.File, os.FileInfo, error)

	// GetCatalogFS returns a filesystem interface for the catalog
	GetCatalogFS(catalog string) (fs.FS, error)

	// GetIndex returns the index for a catalog (if metas handler is enabled)
	GetIndex(catalog string) (Index, error)
}

CatalogStore defines the storage interface needed by handlers

type GraphQLQueriesMode

type GraphQLQueriesMode bool

GraphQLQueriesMode controls whether GraphQL queries are enabled

const (
	GraphQLQueriesDisabled GraphQLQueriesMode = false
	GraphQLQueriesEnabled  GraphQLQueriesMode = true
)

type Index

type Index interface {
	Get(catalogFile io.ReaderAt, schema, pkg, name string) io.Reader
}

Index provides methods for looking up catalog content by schema/package/name

type MetasHandlerMode

type MetasHandlerMode bool

MetasHandlerMode controls whether the metas API endpoint is enabled

const (
	MetasHandlerDisabled MetasHandlerMode = false
	MetasHandlerEnabled  MetasHandlerMode = true
)

Jump to

Keyboard shortcuts

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