GithubHelp home page GithubHelp logo

almar's Introduction

README.org

1 简介

Almar (之前的Minitree) 是一个以树形结构组织数据的工具。

2 配置文件

配置文件分为两种:主配置和模型配置。

2.1 主配置

配置数据和WEB相关的东西,例如:

---
database:
    host: localhost
    port: 5432
    user: jianingy
    schema: almar
    table: object
    min_connections: 4
    max_connections: 8

server:
    port: 9999
    max_threads: 4

model:
    - ~/devel/almar/etc/model.yaml

2.2 模型配置

对数据类型进行配置,例如:

---
- model: asset
  member:
    - name: serialno
      datatype: string
      flag:
        blank: false
        unique: inherit
    - name: price
      datatype: float
      flag:
        blank: true

- model: asset.netable
  member:
      - name: fqdn
        datatype: string
        flag:
          unique: inherit
          blank: false
      - name: ip4
        datatype: ip4
        flag:
          unique: inherit
          blank: false

- model: asset.netable.server
  member:
      - name: cpu
        datatype: string
        flag:
          blank: true
      - name: mem
        datatype: float
        flag:
          blank: true
      - name: hd
        datatype: float
        flag:
          blank: true

数据类型配置是以继承关系存在的。例如:asset 中定义了 “serialno”,那么 asset 的子类型“asset.netable”就会自动继承“serialno”这个字段。

数据类型的字段配置中 flag 提供对数据类型的一些限制:

unique
唯一性限制
blank
非空限制

3 运行服务

twistd -n almar -c 主配置文件.yaml

4 API

Almar 采用 JSON-RPC 作为 API。 具体使用方法请参考 test 目录下的测试用 例。

almar's People

Contributors

jianingy avatar wangwang avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

almar's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.