Documentation ¶
Index ¶
- Variables
- func NewService(addr string) protob.NitroServer
- type Service
- func (svc *Service) AddDatabase(ctx context.Context, req *protob.AddDatabaseRequest) (*protob.AddDatabaseResponse, error)
- func (svc *Service) Apply(ctx context.Context, request *protob.ApplyRequest) (*protob.ApplyResponse, error)
- func (svc *Service) ImportDatabase(stream protob.Nitro_ImportDatabaseServer) error
- func (svc *Service) Ping(ctx context.Context, request *protob.PingRequest) (*protob.PingResponse, error)
- func (svc *Service) RemoveDatabase(ctx context.Context, req *protob.RemoveDatabaseRequest) (*protob.RemoveDatabaseResponse, error)
- func (svc *Service) Version(ctx context.Context, request *protob.VersionRequest) (*protob.VersionResponse, error)
Constants ¶
This section is empty.
Variables ¶
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 ¶
Service implements the protob.NitroServer interface
func (*Service) AddDatabase ¶
func (svc *Service) AddDatabase(ctx context.Context, req *protob.AddDatabaseRequest) (*protob.AddDatabaseResponse, error)
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 ¶
func (svc *Service) RemoveDatabase(ctx context.Context, req *protob.RemoveDatabaseRequest) (*protob.RemoveDatabaseResponse, error)
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