journal

package module
v0.0.0-...-a2e9668 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2020 License: GPL-3.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Online Journal

This project is WIP

Plan

Personal online-journal app. Might morph into something more.

Technology

Serverless, using AWS lambda written in Go

DynomoDB

Project

.
├── LICENSE
├── README.md
├── aws         // AWS config
├── cmd         // main.go
├── db.go       // Interface to DynamoDB
├── frontend    // ReactJS app
├── go.mod
├── go.sum
├── handler.go  // Lambda code
└── run         // convenience scripts

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LambdaHandler

func LambdaHandler(j Journal) interface{}

LambdaHandler Creates a Lambda Handler

Types

type DynamoDBStore

type DynamoDBStore struct {
	DB *dynamodb.DynamoDB
}

DynamoDBStore DynamoDB implementation of Store

func (*DynamoDBStore) GetItem

func (store *DynamoDBStore) GetItem(UUID string) (*Entry, error)

GetItem implementation of Store interface

func (*DynamoDBStore) GetItems

func (store *DynamoDBStore) GetItems() (entries []*Entry, err error)

GetItems implementation for Store interface

func (*DynamoDBStore) PutItem

func (store *DynamoDBStore) PutItem(en *Entry) error

PutItem implementation for Store interface

type Entry

type Entry struct {
	UUID        string    `json:"UUID"`
	Title       string    `json:"title"`
	Text        string    `json:"text"`
	Sections    []Section `json:"sections"`
	Public      bool      `json:"public"`
	CreatedDate time.Time
}

Entry for journal

type Journal

type Journal struct {
	Store Store
}

Journal struct

type Photo

type Photo struct {
	URL string `json:"url"`
}

Photo of Section

type Section

type Section struct {
	Title  string  `json:"title"`
	Photos []Photo `json:"photos"`
	Text   string  `json:"text"`
}

Section of journal Entry

type Store

type Store interface {
	GetItems() ([]*Entry, error)
	GetItem(string) (*Entry, error)
	PutItem(*Entry) error
}

Store For Journal entries

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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