admin

package
v1.92.0-rc Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package admin implements a server which serves a REST API and a web application to allow performing satellite administration tasks.

NOTE this is work in progress and will eventually replace the current satellite administration server implemented in the parent package, hence this package name is the same than its parent because it will simplify the replace once it's ready.

Index

Constants

This section is empty.

Variables

View Source
var ErrExampleAPI = errs.Class("admin example api")
View Source
var Error = errs.Class("satellite-admin")

Error is the error class that wraps all the errors returned by this package.

Functions

This section is empty.

Types

type Config

type Config struct {
	StaticDir string `` /* 181-byte string literal not displayed */
}

Config defines configuration for the satellite administration server.

type ExampleHandler

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

ExampleHandler is an api handler that implements all Example API endpoints functionality.

func NewExample

func NewExample(log *zap.Logger, mon *monkit.Scope, service ExampleService, router *mux.Router, auth api.Auth) *ExampleHandler

type ExampleService

type ExampleService interface {
	GetExamples(ctx context.Context) ([]string, api.HTTPError)
}

type ParentRouter

type ParentRouter struct {
	Router     *mux.Router
	PathPrefix string
}

ParentRouter is mux.Router with its full path prefix.

type Server

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

Server serves the API endpoints and the web application to allow preforming satellite administration tasks.

func NewServer

func NewServer(log *zap.Logger, listener net.Listener, parentRouter *ParentRouter, config Config) *Server

NewServer creates a satellite administration server instance with the provided dependencies and configurations.

When listener is nil, Server.Run is a noop.

When parentRouter is nil it creates a new Router to attach the server endpoints, otherwise , it attaches them to the provided one, allowing to expose its functionality through another server.

func (*Server) Close

func (server *Server) Close() error

Close closes server and underlying listener.

func (*Server) Run

func (server *Server) Run(ctx context.Context) error

Run starts the administration HTTP server using the provided listener. If listener is nil, it does nothing and return nil.

Directories

Path Synopsis
Package main defines the satellite administration API through the API generator and generates source code of the API server handlers and clients and the documentation markdown document.
Package main defines the satellite administration API through the API generator and generates source code of the API server handlers and clients and the documentation markdown document.

Jump to

Keyboard shortcuts

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