mdrc

package
v0.0.0-...-5085ddf Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2022 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Copyright © 2022 Cédric L’homme <public@l-homme.com>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Copyright © 2022 Cédric L’homme <public@l-homme.com>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command []byte

type Commands

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

func NewCommands

func NewCommands(l logr.Logger, data []byte) *Commands

NewCommands creates a Commands structure from extracted commands from data.

func (*Commands) Command

func (f *Commands) Command(i int) Command

Command returns the command at index i.

func (*Commands) Valid

func (f *Commands) Valid(i int) bool

Valid returns true if the index i is a correct index for commands.

type Controller

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

func NewController

func NewController(l logr.Logger, c *Commands, h *HTML) *Controller

func (*Controller) HandleCommand

func (c *Controller) HandleCommand() func(http.ResponseWriter, *http.Request)

HandleCommand handles the endpoint that exposes the commands.

func (*Controller) HandleHTML

func (c *Controller) HandleHTML() func(http.ResponseWriter, *http.Request)

HandleHTML handles the endpoint that exposes the HTML part.

type HTML

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

func NewHTML

func NewHTML(l logr.Logger, data []byte) *HTML

func (*HTML) Rendered

func (h *HTML) Rendered() string

Rendered returns the final HTML rendered with mdrc injections.

type Server

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

func NewServer

func NewServer(l logr.Logger, c *Controller) *Server

func (*Server) Serve

func (s *Server) Serve(port string)

Serve runs the network connexion and the HTTP transport.

Jump to

Keyboard shortcuts

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