Coder Social home page Coder Social logo

geniusesgroup / memar-go Goto Github PK

View Code? Open in Web Editor NEW
42.0 5.0 5.0 1.6 MB

Developing software framework for the GO programming language

License: Apache License 2.0

Go 99.99% Assembly 0.01%
rpc-library http-server validation sdk-go golang autogeneration database datastore zero-copy rpc

memar-go's Introduction

Memar - Golang version

GoDoc Go Report

Memar as a Go language library is a repository wrapper to store all implementation of Memar and others protocols and algorithms to make a digital software more easily in better performance. You can use all packages exported APIs, go generator mechanism or by library commands to access some useful APIs from command line easily.

If you want to get insight about memar, You MUST start reading interfaces in protocol package.

Installation

  • Make project directory and suggest use your internet domain name for it.
  • initialize project version control. If you use git run git init or git clone ${repository path}.
  • init go project by go mod init
  • add memar to your project dependency
  • install memar with lang_eng or your desire language
  • initialize the project with desire domain e.g. google.com
  • Complete manifest in main package.
  • Add other data to main package if needed.
  • Implement protocols logic by autogenerate some codes not write them manually.
  • build your organization app with desire tags and target OS and hardwares.
  • run your desire version from /bin/ directory. Strongly suggest run app by systemd on linux or other app manager on other OS.

or easily run the following command under your project, just replace your domain name.

mkdir {domain}
git init
go mod init
go get -u github.com/GeniusesGroup/memar-go
go install github.com/GeniusesGroup/memar-go -tags "lang_eng"
memar app init -d={domain}
memar app build

Commands (CLA)

memar has a the command-line client for the some generator APIs implement in modules. It provides simple access to all APIs functions to make an application, a GUI app, ....

You can get list of all commands and their helps with memar help. We just list some of important commands here that you can run them from within a Go module or any where in your project directory:

  • Initialize a project: memar app init -idn=[internet-domain-name]
  • Add new domain module: memar mod new -dn=[domain-name]
  • Build the apps(os images): memar app build
  • Run the app(os image): memar app run

Build tags

  • dev_mode: first check and change AppMode_Dev const in protocol package to desire behavior
  • tcp_listener:

Code style

Read more here

Contribution Guide

memar-go's People

Contributors

omidhekayati avatar sina-devel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

memar-go's Issues

[service] Improve service finding by ID performance

In this file use GO map as hash table to store and find services by ID but GO map is not effient for simple uint64 type as key! Improve this file by implement internal custom table.

  • Don't use array pointer for buckets due to it is most read table with over 99.9% times.
    image
  • Don't use overflow map||buckets and block procces to expand whole hash table.

[net/tcp] Continue package development

Someone must take responsibility for implementing TCP protocol in user space. I have developed some parts of it but it is not ready to use.
We know that we can't easily port existing code because when TCP is handled on userspace, we must think differently from kernel-level implementation.

[modules/storage] Implement interface to SQL service

Hints:

  • At least need three services: generate mysql.sql, generate mysql.go, and generate volatile-memory.go files.
  • Input example:
// Storage_Fields indicates the domain record data fields.
type Storage_Fields interface {
	RequestID() UserRequestUUID //
	DomainID() uint64           // Domain MediaTypeID e.g. product, content, ... domain
	ServiceID() uint64          //
	UserID() protocol.UserID    // user domain
	UserConnectionID() [16]byte // Store to remember which request belongs to which Connection/AppInstance.
	Time() protocol.Time // Request time or save Time of the request not the created record by this record.
}

// Storage_Services indicates the domain storage layer services.
type Storage_Services interface {
	Save(sf Storage_Fields) (err protocol.Error)

	Get(requestID UserRequestUUID, vo protocol.VersionOffset) (sf Storage_Fields, err protocol.Error)

	FindByDomain(domainID uint64, offset, limit uint64) (requestIDs []UserRequestUUID, err protocol.Error)
	FindByUser(userID [16]byte, offset, limit uint64) (requestIDs []UserRequestUUID, err protocol.Error)
}
  • Develop to easily add support for multiple storage engines (other than SQL based) in future
  • generate MySQL, Postgres, ... optimized SQL not general SQL codes
  • Use SQL procedure for queries not send a query in each request.

Problems need to fix in comparison to other modules:

  • As long as it is possible logic must be in compile-time not runtime.
  • Respect object life cycle and abstraction patterns. e.g. Initiliaze of each domain storage must take place in that domain, not the main of the application.
  • All existing modules in the Go ecosystem force the developer to write the storage layer handly! we need to write efficient codes for the storage layer by given storage interfaces.
    It means we don't need these fancy things:
users, err := models.Users(
  Select("id", "name"),
  InnerJoin("credit_cards c on c.user_id = users.id"),
  Where("age > ?", 30),
  AndIn("c.kind in ?", "visa", "mastercard"),
  Or("email like ?", `%aol.com%`),
  GroupBy("id", "name"),
  Having("count(c.id) > ?", 2),
  Limit(5),
  Offset(6),
).All(ctx, db)

other modules:

[table/...] Start develope some data structure

"Go" has introduced Generic development, we need some efficient table data structure that can be used in many other packages e.g. #2, #7, ...

Also, We can move buffer package ideas to table/... and not use buffer words anymore.

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.