Permalink
Browse files

rename Form API to Forma

  • Loading branch information...
kamilsk committed Jul 21, 2018
1 parent fba4568 commit 4cbcc90ae70369557c709c7817b2bb6406202680
Showing with 18 additions and 18 deletions.
  1. +2 βˆ’2 README.md
  2. +1 βˆ’1 cmd/root.go
  3. +3 βˆ’3 docs/index.html
  4. +1 βˆ’1 pkg/server/contract.go
  5. +1 βˆ’1 pkg/server/router/contract.go
  6. +1 βˆ’1 pkg/server/server.go
  7. +7 βˆ’7 pkg/service/service.go
  8. +2 βˆ’2 pkg/service/service_test.go
@@ -1,4 +1,4 @@
> # Form API [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Data%20Collector%20as%20a%20Service&url=https://kamilsk.github.io/form-api/&via=ikamilsk&hashtags=go,service,data-collector)
> # Forma [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Data%20Collector%20as%20a%20Service&url=https://kamilsk.github.io/form-api/&via=ikamilsk&hashtags=go,service,data-collector)
> [![Analytics](https://ga-beacon.appspot.com/UA-109817251-15/form-api/readme?pixel)](https://kamilsk.github.io/form-api/)
> Data Collector as a Service — your personal server for HTML forms.
@@ -61,7 +61,7 @@ HTTP client to work with the API - you can import data for it from the [file](en
```bash
$ form-api --help
Form API
Forma
Usage:
form-api [command]
@@ -11,7 +11,7 @@ import (
)

// RootCmd is the entry point.
var RootCmd = &cobra.Command{Use: "form-api", Short: "Form API"}
var RootCmd = &cobra.Command{Use: "form-api", Short: "Forma"}

func init() {
RootCmd.AddCommand(completionCmd, controlCmd, migrateCmd, runCmd)
@@ -2,7 +2,7 @@
<html class="no-js" lang="en">
<head>
<meta charset="UTF-8">
<title>Form API | Data Collector as a Service</title>
<title>Forma | Data Collector as a Service</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="assets/css/style.css">
@@ -76,7 +76,7 @@

<div class="position-relative overflow-hidden p-3 p-md-5 m-md-3 text-center bg-light">
<div class="col-md-5 p-lg-5 mx-auto my-5">
<h1 class="display-4 font-weight-normal">Form API</h1>
<h1 class="display-4 font-weight-normal">Forma</h1>
<p class="lead font-weight-normal">Data Collector as a Service<br>&mdash; your personal server for HTML forms</p>
<small>Part of <strong>Hugs Platform</strong>, made with <i class="fas fa-heart" style="color: red;"></i>️ by
<a href="https://www.octolab.org/" title="OctoLab Open(src Source)">OctoLab</a></small>
@@ -103,7 +103,7 @@ <h2><i class="far fa-file-code"></i></h2>
<h3>Static Sites</h3>
<p>We use static site generators like awesome <a href="https://gohugo.io/"><strong>Hugo</strong></a>
in our everyday work. We chose to get missing functionality from microservices like the
<strong>Form API</strong>. You can use it wherever you want - on simple landing pages or sites
<strong>Forma</strong>. You can use it wherever you want - on simple landing pages or sites
based on <strong>Hugo</strong> or <a href="https://www.gatsbyjs.org/"><strong>Gatsby</strong></a>,
or product from the <a href="https://www.staticgen.com/"><strong>StaticGen</strong></a> list.
</div>
@@ -2,7 +2,7 @@ package server

import "github.com/kamilsk/form-api/pkg/transfer/api/v1"

// Service defines the behavior of Form API service.
// Service defines the behavior of the Forma service.
type Service interface {
// HandleGetV1 handles an input request.
HandleGetV1(v1.GetRequest) v1.GetResponse
@@ -2,7 +2,7 @@ package router

import "net/http"

// Server defines the behavior of Form API server.
// Server defines the behavior of the Forma server.
type Server interface {
// GetV1 is responsible for `GET /api/v1/{Schema.ID}` request handling.
GetV1(http.ResponseWriter, *http.Request)
@@ -25,7 +25,7 @@ const (
timeoutKey = "_timeout"
)

// New returns a new instance of Form API server.
// New returns a new instance of the Forma server.
// It can raise the panic if base URL is invalid or HTML templates are not available.
func New(baseURL, tplPath string, service Service) *Server {
u, err := url.Parse(baseURL)
@@ -6,25 +6,25 @@ import (
"github.com/kamilsk/form-api/pkg/transfer/api/v1"
)

// New returns a new instance of Form API service.
func New(dao Storage) *FormAPI {
return &FormAPI{dao: dao}
// New returns a new instance of the Forma service.
func New(dao Storage) *Forma {
return &Forma{dao: dao}
}

// FormAPI is the primary application service.
type FormAPI struct {
// Forma is the primary application service.
type Forma struct {
dao Storage
}

// HandleGetV1 handles an input request.
func (s *FormAPI) HandleGetV1(request v1.GetRequest) v1.GetResponse {
func (s *Forma) HandleGetV1(request v1.GetRequest) v1.GetResponse {
var response v1.GetResponse
response.Schema, response.Error = s.dao.Schema(request.UUID)
return response
}

// HandlePostV1 handles an input request.
func (s *FormAPI) HandlePostV1(request v1.PostRequest) v1.PostResponse {
func (s *Forma) HandlePostV1(request v1.PostRequest) v1.PostResponse {
var (
response v1.PostResponse
verified map[string][]string
@@ -17,7 +17,7 @@ import (

const UUID domain.UUID = "41ca5e09-3ce2-4094-b108-3ecc257c6fa4"

func TestFormAPI_HandleGetV1(t *testing.T) {
func TestForma_HandleGetV1(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()

@@ -46,7 +46,7 @@ func TestFormAPI_HandleGetV1(t *testing.T) {
}
}

func TestFormAPI_HandlePostV1(t *testing.T) {
func TestForma_HandlePostV1(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()

0 comments on commit 4cbcc90

Please sign in to comment.