api

package
v0.11.1-0...-8ab92b3 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version string

Functions

func NewService

func NewService(addr string) protob.NitroServer

NewService takes the address to the Caddy API and returns an API struct that implements the gRPC API used in the proxy container. The gRPC API is used to handle making changes to the Caddy Server via its local API. If no addr is provided, it will set the default addr to http://127.0.0.1:2019

Types

type Service

type Service struct {
	Addr     string
	HTTP     *http.Client
	Importer database.Importer
}

Service implements the protob.NitroServer interface

func (*Service) AddDatabase

AddDatabase handle creating a new database for a hostname

func (*Service) Apply

func (svc *Service) Apply(ctx context.Context, request *protob.ApplyRequest) (*protob.ApplyResponse, error)

Apply is used to take all of the sites from a Nitro config and apply those changes. The Sites in protob.ApplyRequest represents the hostname, aliases (in a comma delimited list), and the port for the service. The NGINX container type uses port 8080 and the PHP-FPM container type uses port 9000.

func (*Service) ImportDatabase

func (svc *Service) ImportDatabase(stream protob.Nitro_ImportDatabaseServer) error

ImportDatabase is used to handle streaming requests from the client and import a database from a backup into the remote database container.

func (*Service) Ping

func (svc *Service) Ping(ctx context.Context, request *protob.PingRequest) (*protob.PingResponse, error)

Ping returns a simple response "pong" from the gRPC API to verify connectivity.

func (*Service) RemoveDatabase

RemoveDatabase handles removing a specific database from a database container

func (*Service) Version

func (svc *Service) Version(ctx context.Context, request *protob.VersionRequest) (*protob.VersionResponse, error)

Version is used to check the container image version with the CLI version

Jump to

Keyboard shortcuts

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