api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UnknownNetwork = "Unknown"
)

Variables

This section is empty.

Functions

func ContentType

func ContentType(filename string, bytes []byte) string

ContentType returns the content type of the given file. It uses mime.TypeByExtension to determine the content type, if it fails, it uses http.DetectContentType to determine the content type, which is heavier to run. If http.DetectContentType fails, it returns "application/octet-stream".

func InjectHostedByMassaBox

func InjectHostedByMassaBox(content []byte, chainID uint64) []byte

InjectHostedByMassaBox injects a "Hosted by Massa" box into the HTML content

func SubdomainMiddleware

func SubdomainMiddleware(handler http.Handler, conf *config.ServerConfig) http.Handler

SubdomainMiddleware handles subdomain website serving.

Types

type API

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

func NewAPI

func NewAPI(conf *config.ServerConfig) *API

func (*API) Start

func (a *API) Start()

Start starts the API server.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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