starliner

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2019 License: GPL-3.0 Imports: 14 Imported by: 0

README

Starliner

A opinionated yet flexible journaling platform

Actually, this repo only contains the backend code,
for frontend code checkout StarTrack.
Currently,there are two cmd in this repo, starliner and sl-oauth.
starliner is for running the api server,
while sl-oauth is a command line helper to aid the authencation processcess

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DataStoreType string
	URL           string
	Listen        string
	Provider      string
	UserIDs       []string
}

Config ...

type MongoDBDataStore

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

MongoDBDataStore ...

func NewMongoDBDataStore

func NewMongoDBDataStore(url string) (*MongoDBDataStore, error)

NewMongoDBDataStore ...

func (*MongoDBDataStore) Close

func (ds *MongoDBDataStore) Close() error

Close ...

func (*MongoDBDataStore) Commit

func (ds *MongoDBDataStore) Commit(p *Post) (string, error)

Commit ...

func (*MongoDBDataStore) Fetch

func (ds *MongoDBDataStore) Fetch(id string) (*Post, error)

Fetch ...

func (*MongoDBDataStore) FetchTimeline

func (ds *MongoDBDataStore) FetchTimeline(count int) ([]*Post, error)

FetchTimeline ...

func (*MongoDBDataStore) Filter

func (ds *MongoDBDataStore) Filter(filter bson.D, count int) ([]*Post, error)

Filter ...

func (*MongoDBDataStore) GetRev

func (ds *MongoDBDataStore) GetRev() (string, error)

GetRev ...

func (*MongoDBDataStore) Init

func (ds *MongoDBDataStore) Init() error

Init ...

func (*MongoDBDataStore) Remove

func (ds *MongoDBDataStore) Remove(id string) error

Remove ...

type Post

type Post struct {
	ID     string   `bson:"ID"`
	Author string   `bson:"Author"`
	Tags   []string `bson:"Tags"`
	Body   string   `bson:"Body"`
}

Post ...

func NewPost

func NewPost(author string, tags []string, body string) (*Post, error)

NewPost ...

func (*Post) String

func (p *Post) String() (string, error)

String ...

func (*Post) Time

func (p *Post) Time() (string, error)

Time ...

type Starliner

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

Starliner ...

func NewStarliner

func NewStarliner(config Config) (*Starliner, error)

NewStarliner ...

func (*Starliner) Auth

func (sl *Starliner) Auth(c *gin.Context)

Auth ...

func (*Starliner) Start

func (sl *Starliner) Start() error

Start ...

func (*Starliner) Stop

func (sl *Starliner) Stop() error

Stop ...

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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