Merge pull request #1 from xdrm-io/migrate/github
Migrate repo to GitHub
This commit is contained in:
commit
0ee814abbe
11
.drone.yml
11
.drone.yml
|
@ -1,11 +0,0 @@
|
|||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: default
|
||||
|
||||
steps:
|
||||
- name: test
|
||||
image: golang:1.13
|
||||
commands:
|
||||
- go get ./...
|
||||
- go test -v -race -cover -coverprofile ./coverage.out ./...
|
|
@ -0,0 +1,27 @@
|
|||
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
|
20
README.md
20
README.md
|
@ -1,6 +1,6 @@
|
|||
<p align="center">
|
||||
<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 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>
|
||||
</p>
|
||||
|
||||
|
@ -10,7 +10,11 @@
|
|||
Fast, intuitive, and powerful configuration-driven engine for faster and easier <em>REST</em> development.
|
||||
</p>
|
||||
|
||||
[![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)
|
||||
[![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)
|
||||
|
||||
## Presentation
|
||||
|
||||
|
@ -43,11 +47,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 git.xdrm.io/go/aicra
|
||||
$ go get -u github.com/xdrm-io/aicra
|
||||
```
|
||||
2. Import it in your code:
|
||||
```go
|
||||
import "git.xdrm.io/go/aicra"
|
||||
import "github.com/xdrm-io/aicra"
|
||||
```
|
||||
|
||||
## What's automated
|
||||
|
@ -83,9 +87,9 @@ import (
|
|||
"net/http"
|
||||
"os"
|
||||
|
||||
"git.xdrm.io/go/aicra"
|
||||
"git.xdrm.io/go/aicra/api"
|
||||
"git.xdrm.io/go/aicra/datatype/builtin"
|
||||
"github.com/xdrm-io/aicra"
|
||||
"github.com/xdrm-io/aicra/api"
|
||||
"github.com/xdrm-io/aicra/datatype/builtin"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"context"
|
||||
"net/http"
|
||||
|
||||
"git.xdrm.io/go/aicra/internal/ctx"
|
||||
"github.com/xdrm-io/aicra/internal/ctx"
|
||||
)
|
||||
|
||||
// GetRequest extracts the current request from a context.Context
|
||||
|
|
|
@ -5,9 +5,9 @@ import (
|
|||
"io"
|
||||
"net/http"
|
||||
|
||||
"git.xdrm.io/go/aicra/datatype"
|
||||
"git.xdrm.io/go/aicra/internal/config"
|
||||
"git.xdrm.io/go/aicra/internal/dynfunc"
|
||||
"github.com/xdrm-io/aicra/datatype"
|
||||
"github.com/xdrm-io/aicra/internal/config"
|
||||
"github.com/xdrm-io/aicra/internal/dynfunc"
|
||||
)
|
||||
|
||||
// Builder for an aicra server
|
||||
|
|
|
@ -7,8 +7,8 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"git.xdrm.io/go/aicra/api"
|
||||
"git.xdrm.io/go/aicra/datatype/builtin"
|
||||
"github.com/xdrm-io/aicra/api"
|
||||
"github.com/xdrm-io/aicra/datatype/builtin"
|
||||
)
|
||||
|
||||
func addBuiltinTypes(b *Builder) error {
|
||||
|
|
|
@ -3,7 +3,7 @@ package builtin
|
|||
import (
|
||||
"reflect"
|
||||
|
||||
"git.xdrm.io/go/aicra/datatype"
|
||||
"github.com/xdrm-io/aicra/datatype"
|
||||
)
|
||||
|
||||
// AnyDataType is what its name tells
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"git.xdrm.io/go/aicra/datatype/builtin"
|
||||
"github.com/xdrm-io/aicra/datatype/builtin"
|
||||
)
|
||||
|
||||
func TestAny_AvailableTypes(t *testing.T) {
|
||||
|
|
|
@ -3,7 +3,7 @@ package builtin
|
|||
import (
|
||||
"reflect"
|
||||
|
||||
"git.xdrm.io/go/aicra/datatype"
|
||||
"github.com/xdrm-io/aicra/datatype"
|
||||
)
|
||||
|
||||
// BoolDataType is what its name tells
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"git.xdrm.io/go/aicra/datatype/builtin"
|
||||
"github.com/xdrm-io/aicra/datatype/builtin"
|
||||
)
|
||||
|
||||
func TestBool_AvailableTypes(t *testing.T) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"encoding/json"
|
||||
"reflect"
|
||||
|
||||
"git.xdrm.io/go/aicra/datatype"
|
||||
"github.com/xdrm-io/aicra/datatype"
|
||||
)
|
||||
|
||||
// FloatDataType is what its name tells
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"math"
|
||||
"testing"
|
||||
|
||||
"git.xdrm.io/go/aicra/datatype/builtin"
|
||||
"github.com/xdrm-io/aicra/datatype/builtin"
|
||||
)
|
||||
|
||||
func TestFloat64_AvailableTypes(t *testing.T) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"math"
|
||||
"reflect"
|
||||
|
||||
"git.xdrm.io/go/aicra/datatype"
|
||||
"github.com/xdrm-io/aicra/datatype"
|
||||
)
|
||||
|
||||
// IntDataType is what its name tells
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"math"
|
||||
"testing"
|
||||
|
||||
"git.xdrm.io/go/aicra/datatype/builtin"
|
||||
"github.com/xdrm-io/aicra/datatype/builtin"
|
||||
)
|
||||
|
||||
func TestInt_AvailableTypes(t *testing.T) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"regexp"
|
||||
"strconv"
|
||||
|
||||
"git.xdrm.io/go/aicra/datatype"
|
||||
"github.com/xdrm-io/aicra/datatype"
|
||||
)
|
||||
|
||||
var fixedLengthRegex = regexp.MustCompile(`^string\((\d+)\)$`)
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"git.xdrm.io/go/aicra/datatype/builtin"
|
||||
"github.com/xdrm-io/aicra/datatype/builtin"
|
||||
)
|
||||
|
||||
func TestString_AvailableTypes(t *testing.T) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"math"
|
||||
"reflect"
|
||||
|
||||
"git.xdrm.io/go/aicra/datatype"
|
||||
"github.com/xdrm-io/aicra/datatype"
|
||||
)
|
||||
|
||||
// UintDataType is what its name tells
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"math"
|
||||
"testing"
|
||||
|
||||
"git.xdrm.io/go/aicra/datatype/builtin"
|
||||
"github.com/xdrm-io/aicra/datatype/builtin"
|
||||
)
|
||||
|
||||
func TestUint_AvailableTypes(t *testing.T) {
|
||||
|
|
2
go.mod
2
go.mod
|
@ -1,3 +1,3 @@
|
|||
module git.xdrm.io/go/aicra
|
||||
module github.com/xdrm-io/aicra
|
||||
|
||||
go 1.16
|
||||
|
|
|
@ -6,10 +6,10 @@ import (
|
|||
"net/http"
|
||||
"strings"
|
||||
|
||||
"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"
|
||||
"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"
|
||||
)
|
||||
|
||||
// Handler wraps the builder to handle requests
|
||||
|
|
|
@ -10,9 +10,9 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"git.xdrm.io/go/aicra"
|
||||
"git.xdrm.io/go/aicra/api"
|
||||
"git.xdrm.io/go/aicra/datatype/builtin"
|
||||
"github.com/xdrm-io/aicra"
|
||||
"github.com/xdrm-io/aicra/api"
|
||||
"github.com/xdrm-io/aicra/datatype/builtin"
|
||||
)
|
||||
|
||||
func addBuiltinTypes(b *aicra.Builder) error {
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"net/http"
|
||||
"strings"
|
||||
|
||||
"git.xdrm.io/go/aicra/datatype"
|
||||
"github.com/xdrm-io/aicra/datatype"
|
||||
)
|
||||
|
||||
// Server definition
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"git.xdrm.io/go/aicra/datatype/builtin"
|
||||
"github.com/xdrm-io/aicra/datatype/builtin"
|
||||
)
|
||||
|
||||
func TestLegalServiceName(t *testing.T) {
|
||||
|
|
|
@ -3,7 +3,7 @@ package config
|
|||
import (
|
||||
"reflect"
|
||||
|
||||
"git.xdrm.io/go/aicra/datatype"
|
||||
"github.com/xdrm-io/aicra/datatype"
|
||||
)
|
||||
|
||||
// Parameter represents a parameter definition (from api.json)
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
"regexp"
|
||||
"strings"
|
||||
|
||||
"git.xdrm.io/go/aicra/datatype"
|
||||
"github.com/xdrm-io/aicra/datatype"
|
||||
)
|
||||
|
||||
var braceRegex = regexp.MustCompile(`^{([a-z_-]+)}$`)
|
||||
|
|
|
@ -6,8 +6,8 @@ import (
|
|||
"log"
|
||||
"reflect"
|
||||
|
||||
"git.xdrm.io/go/aicra/api"
|
||||
"git.xdrm.io/go/aicra/internal/config"
|
||||
"github.com/xdrm-io/aicra/api"
|
||||
"github.com/xdrm-io/aicra/internal/config"
|
||||
)
|
||||
|
||||
// Handler represents a dynamic aicra service handler
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
"reflect"
|
||||
"testing"
|
||||
|
||||
"git.xdrm.io/go/aicra/api"
|
||||
"github.com/xdrm-io/aicra/api"
|
||||
)
|
||||
|
||||
type testsignature Signature
|
||||
|
|
|
@ -6,8 +6,8 @@ import (
|
|||
"reflect"
|
||||
"strings"
|
||||
|
||||
"git.xdrm.io/go/aicra/api"
|
||||
"git.xdrm.io/go/aicra/internal/config"
|
||||
"github.com/xdrm-io/aicra/api"
|
||||
"github.com/xdrm-io/aicra/internal/config"
|
||||
)
|
||||
|
||||
// Signature represents input/output arguments for service from the aicra configuration
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"reflect"
|
||||
"testing"
|
||||
|
||||
"git.xdrm.io/go/aicra/api"
|
||||
"github.com/xdrm-io/aicra/api"
|
||||
)
|
||||
|
||||
func TestInputCheck(t *testing.T) {
|
||||
|
|
|
@ -6,8 +6,8 @@ import (
|
|||
"io"
|
||||
"reflect"
|
||||
|
||||
"git.xdrm.io/go/aicra/internal/config"
|
||||
"git.xdrm.io/go/aicra/internal/multipart"
|
||||
"github.com/xdrm-io/aicra/internal/config"
|
||||
"github.com/xdrm-io/aicra/internal/multipart"
|
||||
|
||||
"net/http"
|
||||
"strings"
|
||||
|
|
|
@ -10,7 +10,7 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"git.xdrm.io/go/aicra/internal/config"
|
||||
"github.com/xdrm-io/aicra/internal/config"
|
||||
)
|
||||
|
||||
func getEmptyService() *config.Service {
|
||||
|
|
Loading…
Reference in New Issue