flamingo

package module
v3.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2019 License: OSL-3.0 Imports: 20 Imported by: 14

README

Flamingo

Go Report Card GoDoc Build Status

What is Flamingo

Flamingo is a high productivity go based framework for rapidly building fast and pluggable web projects. It is used to build scalable and maintainable (web)applications.

Flamingo is:

  • open source
  • written in go
  • easy to learn
  • fast and flexible

Go as simple, powerful and typesafe language is great to implement and scale serverside logic. Flamingo has a clean architecture with clear dependencies in mind and offers a typical features and support for nowadays web applications:

  • Powerful Templating Engines. E.g. support for Pug templates with reusable mixins and lightweight scripting.
  • Configuration concepts using yml and support for multiple areas and contexts
  • Powerful Dependency Injection
  • A Module concept for building modular and pluggable applications
  • Authentication concepts and security middleware
  • Flexible routing with support for prefix routes and reverse routing
  • Web Controller Support with: Request / Response / Form Handling etc
  • Operational Readyness: Logging, (distributed) Tracing, Metrics and Healthchecks with seperate endpoint
  • Localisation
  • Commands
  • Sessionhandling and Management
  • GraphQL support and therefore support to build nice SPA and PWAs on top of it
  • Resilience and Caching for external APIs calls.

Flamingo itself does not contain ORM Mapper or libraries - instead it emphasizes "ports and adapters" architecture - so that you have a technology free (domain) model and any possible (and replaceable) persitence behind it. That makes Flamingo useful to build microservices and applications - especially to build "frontends" or portals that require interaction with other (micro) services in a distributed architecture. When sticking to the architectural recommendation you can build modular applications with replaceable adapters that gives you independed testability.

With "Flamingo Commerce" there is an additional active projects that offer rich and flexible features to build modern e-commerce applications.

Getting Started / Hello World

Initialize your Project

mkdir helloworld
cd helloworld
go mod init helloworld

Create main.go:

package main

import (
	"context"
	"net/http"
	"strings"

	"flamingo.me/dingo"
	"flamingo.me/flamingo/v3"
	"flamingo.me/flamingo/v3/core/requestlogger"
	"flamingo.me/flamingo/v3/framework/web"
)

func main() {
	flamingo.App([]dingo.Module{
		new(requestlogger.Module),
		new(module),
	})
}

type module struct{}

func (*module) Configure(injector *dingo.Injector) {
	web.BindRoutes(injector, new(routes))
}

type routes struct{}

func (*routes) Routes(registry *web.RouterRegistry) {
	registry.Route("/", "home")
	registry.HandleAny("home", indexHandler)
}

func indexHandler(ctx context.Context, req *web.Request) web.Result {
	return &web.Response{
		Status: http.StatusOK,
		Body:   strings.NewReader("Hello World!"),
	}
}

Start server

go run main.go serve

Open http://localhost:3322

The Flamingo Ecosystem

With "Flamingo Commerce" and "Flamingo Carotene" you get your toolkit for building Blazing fast commerce experience layers

Flamingo Commerce

  • Contains flamingo modules that provide „domain“, „application“ and „interface“ logic around commerce features
  • According to „ports and adapters“ these modules can be used with your own „Adapters“ to interact with any API or microservice you want.

Flamingo Carotene

Is the frontend build pipeline featuring pug and atomic design pattern

It can be used to implement modern and blazing fast commerce web applications.

Getting started

Check out the hello-world example and read the rendered documentation under http://docs.flamingo.me

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func App

func App(modules []dingo.Module, options ...option)

App is a simple app-runner for flamingo

func ChildAreas

func ChildAreas(areas ...*config.Area) func(config *appconfig)

ChildAreas allows to define additional config areas for roots

func ConfigDir

func ConfigDir(configdir string) func(config *appconfig)

ConfigDir configuration option

func DefaultContext added in v3.1.0

func DefaultContext(name string) func(config *appconfig)

DefaultContext for flamingo to start with

func SetEagerSingletons added in v3.1.0

func SetEagerSingletons(enabled bool) func(config *appconfig)

SetEagerSingletons controls if eager singletons will be created

Types

This section is empty.

Directories

Path Synopsis
core
healthcheck
Package healthcheck provides a healthcheck endpoint under the default route /status/healthcheck Usage: Register your own Status via Dingo: injector.BindMap(new(healthcheck.Status), "yourServiceName").To(yourServiceNameApi.Status{})
Package healthcheck provides a healthcheck endpoint under the default route /status/healthcheck Usage: Register your own Status via Dingo: injector.BindMap(new(healthcheck.Status), "yourServiceName").To(yourServiceNameApi.Status{})
zap
Package framework provides the most necessary basics, such as - service_locator - router - web (including context and response) - web/responder Additionally it provides a router at /_flamingo/json/{handler} for convenient access to DataControllers Additionally it registers two template functions, `get(...)` and `url(...)`
Package framework provides the most necessary basics, such as - service_locator - router - web (including context and response) - web/responder Additionally it provides a router at /_flamingo/json/{handler} for convenient access to DataControllers Additionally it registers two template functions, `get(...)` and `url(...)`
cmd
config
Package config provides supporting code for multi-tenant setups
Package config provides supporting code for multi-tenant setups
web

Jump to

Keyboard shortcuts

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