Przeglądaj źródła

Remove Onyx framework (#10391)

Onyx had the last commit 6 years ago.
Petrik de Heus 1 tydzień temu
rodzic
commit
883c4fbab1

+ 0 - 11
frameworks/Crystal/onyx/README.md

@@ -1,11 +0,0 @@
-# Crystal-Onyx
-
-This is the [Onyx](https://github.com/onyxframework/) test of the Framework Benchmarks. Crystal is a new language that closely resembles Ruby with a goal of removing typed variables and parameters (instead inferencing), whilst maintaining top speed through bindings into C.
-
-The framework consists of multiple components:
-
-[Onyx::HTTP](https://github.com/onyxframework/http) is a collection of HTTP handlers, which essentially are building blocks for your web application
-[Onyx::REST](https://github.com/onyxframework/rest) is a REST layer on top of Onyx::HTTP which implements splitting business and rendering logic into Actions and Views, inspired by Hanami
-[Onyx::SQL](https://github.com/onyxframework/rest) is a database-agnostic SQL ORM
-
-Onyx Framework is designed to be both powerful and adoptable by Crystal newcomers. It utilizes complex concepts like annotations and generics, but hides it under beautiful DSL. Such an approach makes it possible to write less code, thus reducing the possibility of bugs, but still make it easy to extend the framework’s functionality.

+ 0 - 29
frameworks/Crystal/onyx/benchmark_config.json

@@ -1,29 +0,0 @@
-{
-  "framework": "onyx",
-  "tests": [
-    {
-      "default": {
-        "json_url": "/json",
-        "db_url": "/db",
-        "query_url": "/queries?queries=",
-        "update_url": "/updates?queries=",
-        "plaintext_url": "/plaintext",
-        "port": 8080,
-        "approach": "Realistic",
-        "classification": "Fullstack",
-        "database": "Postgres",
-        "framework": "Onyx",
-        "language": "Crystal",
-        "flavor": "None",
-        "orm": "Full",
-        "platform": "None",
-        "webserver": "None",
-        "os": "Linux",
-        "database_os": "Linux",
-        "display_name": "Onyx (PostgreSQL)",
-        "notes": "",
-        "versus": "None"
-      }
-    }
-  ]
-}

+ 0 - 18
frameworks/Crystal/onyx/config.toml

@@ -1,18 +0,0 @@
-[framework]
-name = "onyx"
-
-[main]
-urls.plaintext = "/plaintext"
-urls.json = "/json"
-urls.db = "/db"
-urls.query = "/queries?queries="
-urls.update = "/updates?queries="
-approach = "Realistic"
-classification = "Fullstack"
-database = "Postgres"
-database_os = "Linux"
-os = "Linux"
-orm = "Full"
-platform = "None"
-webserver = "None"
-versus = "None"

+ 0 - 16
frameworks/Crystal/onyx/onyx.dockerfile

@@ -1,16 +0,0 @@
-FROM crystallang/crystal:0.27.2
-
-WORKDIR /onyx
-COPY run.sh run.sh
-COPY src src
-COPY shard.yml shard.yml
-
-ENV DATABASE_URL postgres://benchmarkdbuser:benchmarkdbpass@tfb-database:5432/hello_world?initial_pool_size=56&max_pool_size=56&max_idle_pool_size=56
-ENV TEST_HOST tfb-server
-ENV CRYSTAL_ENV benchmarking
-
-RUN shards install
-RUN crystal build --release --no-debug src/server_postgres.cr
-
-EXPOSE 8080
-CMD bash run.sh

+ 0 - 5
frameworks/Crystal/onyx/run.sh

@@ -1,5 +0,0 @@
-#!/bin/bash
-
-./server_postgres -p 8080 &
-
-wait

+ 0 - 50
frameworks/Crystal/onyx/shard.lock

@@ -1,50 +0,0 @@
-version: 1.0
-shards:
-  callbacks:
-    github: vladfaust/callbacks.cr
-    version: 0.2.0
-
-  db:
-    github: crystal-lang/crystal-db
-    version: 0.5.1
-
-  dotenv:
-    github: gdotdesign/cr-dotenv
-    version: 0.1.0
-
-  exception_page:
-    github: crystal-loot/exception_page
-    version: 0.1.2
-
-  http-params-serializable:
-    github: vladfaust/http-params-serializable
-    version: 0.3.0
-
-  kilt:
-    github: jeromegn/kilt
-    version: 0.4.0
-
-  onyx:
-    github: onyxframework/onyx
-    version: 0.3.1
-
-  onyx-http:
-    github: onyxframework/http
-    version: 0.7.1
-
-  onyx-sql:
-    github: onyxframework/sql
-    version: 0.7.1
-
-  pg:
-    github: will/crystal-pg
-    version: 0.15.0
-
-  radix:
-    github: luislavena/radix
-    version: 0.3.9
-
-  time_format:
-    github: vladfaust/time_format.cr
-    version: 0.1.1
-

+ 0 - 24
frameworks/Crystal/onyx/shard.yml

@@ -1,24 +0,0 @@
-name: onyx
-version: 0.2.0
-
-authors:
-  - Vlad Faust
-  - Carlos Donderis
-
-crystal: 0.27.2
-
-license: MIT
-
-dependencies:
-  onyx:
-    github: onyxframework/onyx
-    version: ~> 0.3.0
-  onyx-http:
-    github: onyxframework/http
-    version: ~> 0.7.0
-  onyx-sql:
-    github: onyxframework/sql
-    version: ~> 0.7.0
-  pg:
-    github: will/crystal-pg
-    version: ~> 0.15.0

+ 0 - 5
frameworks/Crystal/onyx/src/endpoints/random_id.cr

@@ -1,5 +0,0 @@
-module Endpoints::RandomID
-  def random_id
-    Random.rand(10_000).succ
-  end
-end

+ 0 - 25
frameworks/Crystal/onyx/src/endpoints/worlds/many.cr

@@ -1,25 +0,0 @@
-struct Endpoints::Worlds::Many
-  include Onyx::HTTP::Endpoint
-  include RandomID
-
-  QUERY = Models::World.where(id: 0).build(true)[0]
-
-  params do
-    query do
-      type queries : String | Int32 = 1
-    end
-  end
-
-  def call
-    queries = params.query.queries.is_a?(String) ? 1 : params.query.queries.as(Int32)
-
-    worlds = Array(Models::World).new
-
-    queries.clamp(1..500).times.each do
-      world = Onyx.query(Models::World, QUERY, random_id).first
-      worlds << world
-    end
-
-    return Views::Worlds.new(worlds)
-  end
-end

+ 0 - 11
frameworks/Crystal/onyx/src/endpoints/worlds/random.cr

@@ -1,11 +0,0 @@
-struct Endpoints::Worlds::Random
-  include Onyx::HTTP::Endpoint
-  include RandomID
-
-  QUERY = Models::World.where(id: 0).build(true)[0]
-
-  def call
-    world = Onyx.query(Models::World, QUERY, random_id).first
-    return Views::World.new(world)
-  end
-end

+ 0 - 28
frameworks/Crystal/onyx/src/endpoints/worlds/update.cr

@@ -1,28 +0,0 @@
-struct Endpoints::Worlds::Update
-  include Onyx::HTTP::Endpoint
-  include RandomID
-
-  SELECT_QUERY = Models::World.where(id: 0).build(true)[0]
-  UPDATE_QUERY = Models::World.update.set(random_number: 0).where(id: 0).build[0]
-
-  params do
-    query do
-      type queries : String | Int32 = 1
-    end
-  end
-
-  def call
-    queries = params.query.queries.is_a?(String) ? 1 : params.query.queries.as(Int32)
-
-    worlds = Array(Models::World).new
-
-    queries.clamp(1..500).times.each do
-      world = Onyx.query(Models::World, SELECT_QUERY, random_id).first
-      world.random_number = random_id
-      Onyx.exec(UPDATE_QUERY, world.random_number, world.id)
-      worlds << world
-    end
-
-    return Views::Worlds.new(worlds)
-  end
-end

+ 0 - 8
frameworks/Crystal/onyx/src/models/world.cr

@@ -1,8 +0,0 @@
-class Models::World
-  include Onyx::SQL::Model
-
-  schema world do
-    pkey id : Int32
-    type random_number : Int32, key: "randomnumber"
-  end
-end

+ 0 - 37
frameworks/Crystal/onyx/src/server_postgres.cr

@@ -1,37 +0,0 @@
-require "pg"
-require "onyx/sql"
-require "onyx/http"
-
-require "./models/*"
-require "./views/*"
-require "./endpoints/**"
-
-class CustomHandler
-  include HTTP::Handler
-
-  def call(context)
-    context.response.headers["Server"] = "Onyx"
-    context.response.headers["Date"] = HTTP.format_time(Time.now)
-    call_next(context)
-  end
-end
-
-Onyx.draw do
-  get "/json" do |env|
-    env.response.content_type = "application/json"
-    {message: "Hello, World!"}.to_json(env.response)
-  end
-
-  get "/db", Endpoints::Worlds::Random
-  get "/queries", Endpoints::Worlds::Many
-  get "/updates", Endpoints::Worlds::Update
-
-  get "/plaintext" do |env|
-    env.response.content_type = "text/plain"
-    env.response << "Hello, World!"
-  end
-end
-
-Onyx.listen(ENV["TEST_HOST"], 8080) do
-  handlers.unshift(CustomHandler.new)
-end

+ 0 - 13
frameworks/Crystal/onyx/src/views/world.cr

@@ -1,13 +0,0 @@
-struct Views::World
-  include Onyx::HTTP::View
-
-  def initialize(@world : Models::World)
-  end
-
-  json do
-    object do
-      field "id", @world.id
-      field "randomnumber", @world.random_number
-    end
-  end
-end

+ 0 - 8
frameworks/Crystal/onyx/src/views/worlds.cr

@@ -1,8 +0,0 @@
-struct Views::Worlds
-  include Onyx::HTTP::View
-
-  def initialize(@worlds : Enumerable(Models::World))
-  end
-
-  json @worlds.map { |world| Views::World.new(world) }
-end