restcontent

package module
v0.0.0-...-1b95147 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: BSD-3-Clause Imports: 20 Imported by: 0

README

RestContent - Headless CMS for backend developer

Build Status Go Report Card PkgGoDev

RestContent is a Headless CMS written in Go+Alpine, supports multiple sites, media libraries, and multiple users, and provides content management services for iOS, Android, Nuxt, Next, etc.

RestContent is mainly for backend developers, it does not require any configuration files, and provides a simple UI for initialization and configuration. It is very suitable for backend developers who do not want to learn NPM/YARN and do not want to be bound by complex configuration files.

RestContent is still in the early stages of development, and there are still many features to be implemented. If you are interested, please join us.

Maintained by RestSend

Features

  • Based on Go+Alpine, no configuration files, no need to learn NPM/YRAN, support Sqlite and Mysql
  • Multisite
  • Built-in WYSIWYG editor
    • Markdown (based on easymde)
    • HTML editor (based on jodit)
    • JSON editor (based on jsoneditor)
  • Multimedia Library
  • Import and export for easy data migration
  • Built-in initialization UI, no need to understand complex configuration files
  • TODO:
    • Multiple users and rights management
    • Api Token
    • Comment
    • Multi-language

Quick Start

Docker

docker run -d -p 8080:8080 --name restcontent restsend/restcontent

Build from source

git clone https://github.com/restsend/restcontent.git
cd restcontent/cmd
go build
./restcontent

Screenshots

  • Dashboard & Setup
    • image
    • image
  • Import & Export
    • image
    • image
  • Category
    • image
  • Page
    • image
    • image
    • image
  • Post
    • image
    • image
    • image
  • Media
    • image
    • image
  • Setting with database
    • image

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmbedAdminAssets embed.FS

Functions

func Migration

func Migration(db *gorm.DB) error

Types

type ExportJob

type ExportJob struct {
	Options   []string `json:"options" binding:"required"`
	MediaHost string
	From      string
	// contains filtered or unexported fields
}

func (*ExportJob) Dump

func (job *ExportJob) Dump(out *zip.Writer, opt string) (int, int64, error)

func (*ExportJob) GetResult

func (job *ExportJob) GetResult() ExportResult

func (*ExportJob) Start

func (job *ExportJob) Start()

type ExportMeta

type ExportMeta struct {
	BuildTime   string         `json:"buildTime"`
	Options     []ExportOption `json:"options"`
	From        string         `json:"from"`
	MediaHost   string         `json:"mediaHost"`
	MediaPrefix string         `json:"mediaPrefix"`
	ExportTime  time.Time      `json:"exportTime"`
	Author      string         `json:"author,omitempty"`
	Key         string         `json:"key,omitempty"`
}

type ExportOption

type ExportOption struct {
	Name  string `json:"name"`
	Count int    `json:"count"`
	Size  int64  `json:"size"`
}

type ExportResult

type ExportResult struct {
	Reason       string `json:"reason,omitempty"`
	Status       string `json:"status,omitempty"`
	DownloadLink string `json:"downloadLink,omitempty"`
	DownloadSize int64  `json:"downloadSize,omitempty"`
}

type ImportJob

type ImportJob struct {
	Meta ExportMeta

	TmpFileName string
	// contains filtered or unexported fields
}

func (*ImportJob) GetResult

func (job *ImportJob) GetResult() ExportResult

func (*ImportJob) Import

func (job *ImportJob) Import(tx *gorm.DB, zipReader *zip.Reader, opt string) error

func (*ImportJob) Start

func (job *ImportJob) Start(options []string)

type Manager

type Manager struct {
	GitCommit string
	BuildTime string
	// contains filtered or unexported fields
}

func NewManager

func NewManager(db *gorm.DB) *Manager

func (*Manager) AuthRequired

func (m *Manager) AuthRequired(c *gin.Context)

func (*Manager) Prepare

func (m *Manager) Prepare(engine *gin.Engine, lw io.Writer) error

func (*Manager) RegisterHandlers

func (m *Manager) RegisterHandlers(engine *gin.Engine)

type StartImportForm

type StartImportForm struct {
	Key     string   `json:"key" binding:"required"`
	Options []string `json:"options" binding:"required"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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