Go to file
Kevin Franklin Kim 1c472c13bf
fix: docker dir
2024-03-22 16:44:29 +01:00
.github chore: fix typo 2024-03-22 11:47:29 +01:00
.husky chore: add husky and gh workflows 2024-03-21 16:10:08 +01:00
bin preparing repo persistence for fast startups and more fault tolerance 2015-06-30 11:22:30 +02:00
build fix: docker dir 2024-03-22 16:44:29 +01:00
client refactor: rename onLoaded 2024-03-22 16:30:54 +01:00
cmd refactor: rename onLoaded 2024-03-22 16:30:54 +01:00
content feat: upgrade 2024-03-21 16:03:21 +01:00
docs/assets feat: upgrade 2024-03-21 16:03:21 +01:00
pkg refactor: rename onLoaded 2024-03-22 16:30:54 +01:00
requests feat: upgrade 2024-03-21 16:03:21 +01:00
responses feat: upgrade 2024-03-21 16:03:21 +01:00
.editorconfig feat: upgrade 2024-03-21 16:03:21 +01:00
.gitignore feat: upgrade 2024-03-21 16:03:21 +01:00
.golangci.yml feat: upgrade 2024-03-21 16:03:21 +01:00
.goreleaser.yml chore: fix typo 2024-03-22 11:47:29 +01:00
.husky.yaml chore: add husky and gh workflows 2024-03-21 16:10:08 +01:00
contentserver.graffle updated graphics for horizontal scaling 2019-05-29 12:23:55 +02:00
go.mod feat: update cmd flags 2024-03-22 10:38:47 +01:00
go.sum feat: update cmd flags 2024-03-22 10:38:47 +01:00
LICENSE Initial commit 2013-12-26 15:37:02 -08:00
main.go feat: upgrade 2024-03-21 16:03:21 +01:00
Makefile chore: add husky and gh workflows 2024-03-21 16:10:08 +01:00
README.md feat: upgrade 2024-03-21 16:03:21 +01:00

Content Server

Build Status Go Report Card godoc goreleaser

Serves content tree structures very quickly.

Concept

A Server written in GoLang to mix and resolve content from different content sources, e.g. CMS, Blog, Shop and many other more. The server provides a simple to use API for non blocking content repository updates, to resolve site content by an URI or to get deep-linking multilingual URIs for a given contentID.

It's up to you how you use it and which data you want to export to the server. Our intention was to write a fast and cache hazzle-free content server to mix different content sources.

Overview

Export Data

All you have to do is to provide a tree of content nodes as a JSON encoded RepoNode.

Attribute Type Usage
Id string unique id to identify the node
MimeType string mime-type of the node, e.g. text/html, image/png, ...
LinkId string (symbolic) link/alias to another node
Groups []string access control
URI string URI
Name string name
Hidden bool hide in menu
DestinationId string alias / symlink handling
Data map[string]interface{} payload data
Nodes map[string]*RepoNode child nodes
Index []string contains the order of of nodes

Tips

  • If you do not want to build a multi-market website define a generic market, e.g. call it universe
  • keep it lean and do not export content which should not be accessible at all, e.g. you are working on a super secret fancy new category of your website
  • Hidden nodes can be resolved by their uri, but are hidden on nodes
  • To avoid duplicate content provide a DestinationId ( = ContentId of the node you want to reference) instead of URIs

Request Data

There is a PHP Proxy implementation for foomo in Foomo.ContentServer. Feel free to use it or to implement your own proxy in the language you love. The API should be easily to implement in every other framework and language, too.

Update Flowchart

Usage

$ contentserver -h
Usage of contentserver:
  -address string
    	address to bind socket server host:port
  -debug
    	toggle debug mode
  -free-os-mem int
    	free OS mem every X minutes
  -heap-dump int
    	dump heap every X minutes
  -var-dir string
    	where to put my data (default "/var/lib/contentserver")
  -version
    	version info
  -webserver-address string
    	address to bind web server host:port, when empty no webserver will be spawned
  -webserver-path string
    	path to export the webserver on - useful when behind a proxy (default "/contentserver")

License

Copyright (c) foomo under the LGPL 3.0 license.