Compare commits

..

No commits in common. "0ee814abbe9ee7de10f730db56957b2d593eac4b" and "77a1f3b11dfe0e5360c6e76c504b7995c7be0187" have entirely different histories.

31 changed files with 58 additions and 78 deletions

11
.drone.yml Normal file
View File

@ -0,0 +1,11 @@
---
kind: pipeline
type: docker
name: default
steps:
- name: test
image: golang:1.13
commands:
- go get ./...
- go test -v -race -cover -coverprofile ./coverage.out ./...

View File

@ -1,27 +0,0 @@
name: Go
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Build
run: go build -v ./...
- name: Test
run: go test -race -v ./... -cover

View File

@ -1,6 +1,6 @@
<p align="center">
<a href="https://github.com/xdrm-io/aicra">
<img src="https://github.com/xdrm-io/aicra/raw/0.4.0/readme.assets/logo.png" alt="aicra logo" width="200" height="200">
<a href="https://git.xdrm.io/go/aicra">
<img src="https://git.xdrm.io/go/aicra/raw/branch/0.4.0/readme.assets/logo.png" alt="aicra logo" width="200" height="200">
</a>
</p>
@ -10,11 +10,7 @@
Fast, intuitive, and powerful configuration-driven engine for faster and easier <em>REST</em> development.
</p>
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Go version](https://img.shields.io/badge/go_version-1.16-blue.svg)](https://golang.org/doc/go1.16)
[![Go doc](https://pkg.go.dev/badge/github.com/xdrm-io/aicra)](https://pkg.go.dev/github.com/xdrm-io/aicra)
[![Go Report Card](https://goreportcard.com/badge/github.com/xdrm-io/aicra)](https://goreportcard.com/report/github.com/xdrm-io/aicra)
[![Build status](https://github.com/xdrm-io/aicra/actions/workflows/go.yml/badge.svg)](https://github.com/xdrm-io/aicra/actions/workflows/go.yml)
[![Go version](https://img.shields.io/badge/go_version-1.16-blue.svg)](https://golang.org/doc/go1.16) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Go Report Card](https://goreportcard.com/badge/git.xdrm.io/go/aicra)](https://goreportcard.com/report/git.xdrm.io/go/aicra) [![Go doc](https://godoc.org/git.xdrm.io/go/aicra?status.svg)](https://godoc.org/git.xdrm.io/go/aicra) [![Build Status](https://drone.xdrm.io/api/badges/go/aicra/status.svg)](https://drone.xdrm.io/go/aicra)
## Presentation
@ -47,11 +43,11 @@ To install the aicra package, you need to install Go and set your Go workspace f
1. you can use the below Go command to install aicra.
```bash
$ go get -u github.com/xdrm-io/aicra
$ go get -u git.xdrm.io/go/aicra
```
2. Import it in your code:
```go
import "github.com/xdrm-io/aicra"
import "git.xdrm.io/go/aicra"
```
## What's automated
@ -87,9 +83,9 @@ import (
"net/http"
"os"
"github.com/xdrm-io/aicra"
"github.com/xdrm-io/aicra/api"
"github.com/xdrm-io/aicra/datatype/builtin"
"git.xdrm.io/go/aicra"
"git.xdrm.io/go/aicra/api"
"git.xdrm.io/go/aicra/datatype/builtin"
)
func main() {

View File

@ -4,7 +4,7 @@ import (
"context"
"net/http"
"github.com/xdrm-io/aicra/internal/ctx"
"git.xdrm.io/go/aicra/internal/ctx"
)
// GetRequest extracts the current request from a context.Context

View File

@ -5,9 +5,9 @@ import (
"io"
"net/http"
"github.com/xdrm-io/aicra/datatype"
"github.com/xdrm-io/aicra/internal/config"
"github.com/xdrm-io/aicra/internal/dynfunc"
"git.xdrm.io/go/aicra/datatype"
"git.xdrm.io/go/aicra/internal/config"
"git.xdrm.io/go/aicra/internal/dynfunc"
)
// Builder for an aicra server

View File

@ -7,8 +7,8 @@ import (
"strings"
"testing"
"github.com/xdrm-io/aicra/api"
"github.com/xdrm-io/aicra/datatype/builtin"
"git.xdrm.io/go/aicra/api"
"git.xdrm.io/go/aicra/datatype/builtin"
)
func addBuiltinTypes(b *Builder) error {

View File

@ -3,7 +3,7 @@ package builtin
import (
"reflect"
"github.com/xdrm-io/aicra/datatype"
"git.xdrm.io/go/aicra/datatype"
)
// AnyDataType is what its name tells

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/xdrm-io/aicra/datatype/builtin"
"git.xdrm.io/go/aicra/datatype/builtin"
)
func TestAny_AvailableTypes(t *testing.T) {

View File

@ -3,7 +3,7 @@ package builtin
import (
"reflect"
"github.com/xdrm-io/aicra/datatype"
"git.xdrm.io/go/aicra/datatype"
)
// BoolDataType is what its name tells

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/xdrm-io/aicra/datatype/builtin"
"git.xdrm.io/go/aicra/datatype/builtin"
)
func TestBool_AvailableTypes(t *testing.T) {

View File

@ -4,7 +4,7 @@ import (
"encoding/json"
"reflect"
"github.com/xdrm-io/aicra/datatype"
"git.xdrm.io/go/aicra/datatype"
)
// FloatDataType is what its name tells

View File

@ -5,7 +5,7 @@ import (
"math"
"testing"
"github.com/xdrm-io/aicra/datatype/builtin"
"git.xdrm.io/go/aicra/datatype/builtin"
)
func TestFloat64_AvailableTypes(t *testing.T) {

View File

@ -5,7 +5,7 @@ import (
"math"
"reflect"
"github.com/xdrm-io/aicra/datatype"
"git.xdrm.io/go/aicra/datatype"
)
// IntDataType is what its name tells

View File

@ -5,7 +5,7 @@ import (
"math"
"testing"
"github.com/xdrm-io/aicra/datatype/builtin"
"git.xdrm.io/go/aicra/datatype/builtin"
)
func TestInt_AvailableTypes(t *testing.T) {

View File

@ -5,7 +5,7 @@ import (
"regexp"
"strconv"
"github.com/xdrm-io/aicra/datatype"
"git.xdrm.io/go/aicra/datatype"
)
var fixedLengthRegex = regexp.MustCompile(`^string\((\d+)\)$`)

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/xdrm-io/aicra/datatype/builtin"
"git.xdrm.io/go/aicra/datatype/builtin"
)
func TestString_AvailableTypes(t *testing.T) {

View File

@ -5,7 +5,7 @@ import (
"math"
"reflect"
"github.com/xdrm-io/aicra/datatype"
"git.xdrm.io/go/aicra/datatype"
)
// UintDataType is what its name tells

View File

@ -5,7 +5,7 @@ import (
"math"
"testing"
"github.com/xdrm-io/aicra/datatype/builtin"
"git.xdrm.io/go/aicra/datatype/builtin"
)
func TestUint_AvailableTypes(t *testing.T) {

2
go.mod
View File

@ -1,3 +1,3 @@
module github.com/xdrm-io/aicra
module git.xdrm.io/go/aicra
go 1.16

View File

@ -6,10 +6,10 @@ import (
"net/http"
"strings"
"github.com/xdrm-io/aicra/api"
"github.com/xdrm-io/aicra/internal/config"
"github.com/xdrm-io/aicra/internal/ctx"
"github.com/xdrm-io/aicra/internal/reqdata"
"git.xdrm.io/go/aicra/api"
"git.xdrm.io/go/aicra/internal/config"
"git.xdrm.io/go/aicra/internal/ctx"
"git.xdrm.io/go/aicra/internal/reqdata"
)
// Handler wraps the builder to handle requests

View File

@ -10,9 +10,9 @@ import (
"strings"
"testing"
"github.com/xdrm-io/aicra"
"github.com/xdrm-io/aicra/api"
"github.com/xdrm-io/aicra/datatype/builtin"
"git.xdrm.io/go/aicra"
"git.xdrm.io/go/aicra/api"
"git.xdrm.io/go/aicra/datatype/builtin"
)
func addBuiltinTypes(b *aicra.Builder) error {

View File

@ -7,7 +7,7 @@ import (
"net/http"
"strings"
"github.com/xdrm-io/aicra/datatype"
"git.xdrm.io/go/aicra/datatype"
)
// Server definition

View File

@ -8,7 +8,7 @@ import (
"strings"
"testing"
"github.com/xdrm-io/aicra/datatype/builtin"
"git.xdrm.io/go/aicra/datatype/builtin"
)
func TestLegalServiceName(t *testing.T) {

View File

@ -3,7 +3,7 @@ package config
import (
"reflect"
"github.com/xdrm-io/aicra/datatype"
"git.xdrm.io/go/aicra/datatype"
)
// Parameter represents a parameter definition (from api.json)

View File

@ -6,7 +6,7 @@ import (
"regexp"
"strings"
"github.com/xdrm-io/aicra/datatype"
"git.xdrm.io/go/aicra/datatype"
)
var braceRegex = regexp.MustCompile(`^{([a-z_-]+)}$`)

View File

@ -6,8 +6,8 @@ import (
"log"
"reflect"
"github.com/xdrm-io/aicra/api"
"github.com/xdrm-io/aicra/internal/config"
"git.xdrm.io/go/aicra/api"
"git.xdrm.io/go/aicra/internal/config"
)
// Handler represents a dynamic aicra service handler

View File

@ -6,7 +6,7 @@ import (
"reflect"
"testing"
"github.com/xdrm-io/aicra/api"
"git.xdrm.io/go/aicra/api"
)
type testsignature Signature

View File

@ -6,8 +6,8 @@ import (
"reflect"
"strings"
"github.com/xdrm-io/aicra/api"
"github.com/xdrm-io/aicra/internal/config"
"git.xdrm.io/go/aicra/api"
"git.xdrm.io/go/aicra/internal/config"
)
// Signature represents input/output arguments for service from the aicra configuration

View File

@ -7,7 +7,7 @@ import (
"reflect"
"testing"
"github.com/xdrm-io/aicra/api"
"git.xdrm.io/go/aicra/api"
)
func TestInputCheck(t *testing.T) {

View File

@ -6,8 +6,8 @@ import (
"io"
"reflect"
"github.com/xdrm-io/aicra/internal/config"
"github.com/xdrm-io/aicra/internal/multipart"
"git.xdrm.io/go/aicra/internal/config"
"git.xdrm.io/go/aicra/internal/multipart"
"net/http"
"strings"

View File

@ -10,7 +10,7 @@ import (
"strings"
"testing"
"github.com/xdrm-io/aicra/internal/config"
"git.xdrm.io/go/aicra/internal/config"
)
func getEmptyService() *config.Service {