onex

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 1 Imported by: 0

README

OneX 云原生实战平台

onex

一个专为 Go + 云原生学习而生的企业级 Go 项目

GoDoc Go Report Card GitHub Go Reference
CodeFactor Build GitHub tag (latest SemVer pre-release) Release TODOs

OneX 云原生实战平台是一个 Go 语言 + 云原生实战平台,也是一个企业级的云平台,整个项目遵循最佳实践的思路去构建。

OneX 项目通过提供功能完备、规范、高质量的 Go 源码来实现代码即学习的理念,通过配套的 Go 开发课程,来降低学习难度、扩展学习深度和广度。通过配套的云原生开发社群 孔令飞的云原生实战营,来提高云原生技术学习的效果。

为什么起名 OneX:OneX 寓意该实战项目具有功能全、扩展性强、灵活性高等特点。

Features

OneX 项目实现了企业级应用需要的绝大部分技能点,详细请参考:功能列表

OneX 实战项目同时还具有以下特点:

  • 功能全:课程包含了 Go 开发生涯中几乎用到的所有及实战,包括但不限于以下 4 大技术栈:
    • 软件开发基础技术栈:包含 Linux、Shell 编程、Makefile 编程、Git 等软件开发需要用到的基础技术栈;
    • Go 开发技术栈:Web 编程、各类应用实现(SDK、ETL 数据抽取、认证授权中心、命令行工具、Web 服务、分布式作业、代码检查、代码生成等)、中间件使用、HTTP/HTTPS/GRPC/WebSocket 协议、常用功能设计和开发等;
    • 云原生技术栈(微服务独立):Kubernetes 编程、Docker 实战、Kubernetes 实战、云原生部署实战、声明式编程、不可变基础设施等;
    • 微服务技术栈:分布式日志、监控告警、服务编排、调用链、负载均衡、服务治理、配置中心等。
  • 代码质量高:整个项目具有很高的代码质量,包括但不限于:遵循简洁架构、代码简洁健壮、接口性能高、高可维护性、高可扩展性等;
  • 项目规范:规范先行。整个实战项目具有目录规范、代码规范、日志规范、错误码规范、文档规范、提交规范、版本规范等规范项;
  • 生态闭环:整个项目用到了 Go 开发中的绝大部分功能点、技术栈和实现方式,完全可以通过一个实战项目闭环学习整个 Go 开发技术栈;
  • 微型 Kubernetes 架构:OneX 还是一个微型的 Kubernetes,onex-apiserver、onex-controller-manager 代码实现和架构,跟原生 k8s 基本保持一致;

Architecture

OneX 架构图

架构介绍见:OneX 架构介绍

Installation

安装步骤如下:

$ git clone https://github.com/superproj/onex.git
$ cd onex
$ make docker-install # 本地快速搭建 OneX(容器化),最好用全新安装的 Debian 12 Linux 发行版

安装文档见:OneX 容器部署

其他常用操作如下:

  1. 编译所有组件
$ make buid # # 编译二进制文件,会编译 cmd/ 目录下的所有 main 文件
  1. 编译某个或某几个组件
$ make build BINS=onex-usercenter # 编译 onex-usercenter 组件
$ make build BINS="onex-usercenter onex-gateway" # 编译 onex-usercenter, onex-gateway 组件
  1. 编译时指定版本
$ make build BINS=onex-usercenter VERSION=v0.1.0
  1. 构建 Docker 镜像
$ make image # 构建 docker 镜像,会构建 cmd/ 目录下的所有组件的镜像
$ make image IMAGES="onex-usercenter"
$ make push # 构建并推送镜像

更多 make 操作请参考 make help

Usage/Examples

$ kubectl create -f ${ONEX_ROOT}/manifests/sample/onex/minerset.yaml
$ onexctl --config ${ONEX_CONFIG_DIR}/onexctl.yaml minerset list

更多使用方法,请参考:OneX 项目测试

Documentation

OneX 项目文档 包含了 OneX 项目介绍、OneX 部署、OneX 项目测试、OneX 功能列表、OneX 项目开发文档等。

Feedback

如果您有任何反馈意见,请通过 colin404@foxmail.com 与我联系。

Contributing

欢迎贡献! 请参阅 CONTRIBUTING.md 以了解如何贡献。

请遵守本项目的 行为准则 code of conduct

Authors

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
onex-apiserver
APIServer is the main API server and master for the onex.
APIServer is the main API server and master for the onex.
onex-apiserver/app
Package app does all of the work necessary to create a OneX APIServer by binding together the API, master and APIServer infrastructure.
Package app does all of the work necessary to create a OneX APIServer by binding together the API, master and APIServer infrastructure.
onex-apiserver/app/options
Package options contains flags and options for initializing an apiserver
Package options contains flags and options for initializing an apiserver
onex-cacheserver
cacheserver is a standard, specification-compliant demo example of the onex service.
cacheserver is a standard, specification-compliant demo example of the onex service.
onex-cacheserver/app/options
Package options contains flags and options for initializing an apiserver
Package options contains flags and options for initializing an apiserver
onex-controller-manager
The controller manager contains multiple controllers.
The controller manager contains multiple controllers.
onex-controller-manager/app
Package app implements a server that runs a set of active components.
Package app implements a server that runs a set of active components.
onex-controller-manager/app/options
Package options provides the flags used for the controller manager.
Package options provides the flags used for the controller manager.
onex-fakeserver
fakeserver is a standard, specification-compliant demo example of the onex service.
fakeserver is a standard, specification-compliant demo example of the onex service.
onex-fakeserver/app/options
Package options contains flags and options for initializing an apiserver
Package options contains flags and options for initializing an apiserver
onex-gateway
gateway is the backend portal of onex.
gateway is the backend portal of onex.
onex-gateway/app/options
Package options contains flags and options for initializing an apiserver
Package options contains flags and options for initializing an apiserver
onex-miner-controller
The controller manager contains multiple controllers.
The controller manager contains multiple controllers.
onex-miner-controller/app
Package app implements a server that runs a set of active components.
Package app implements a server that runs a set of active components.
onex-miner-controller/app/options
Package options provides the flags used for the miner controller.
Package options provides the flags used for the miner controller.
onex-minerset-controller
The minerset controller is used to reconcile MinerSet resource.
The minerset controller is used to reconcile MinerSet resource.
onex-minerset-controller/app
Package app implements a server that runs a set of active components.
Package app implements a server that runs a set of active components.
onex-minerset-controller/app/options
Package options provides the flags used for the minerset controller.
Package options provides the flags used for the minerset controller.
onex-nightwatch
The nightwatch binary is responsible for executing some async tasks like linux crontab.
The nightwatch binary is responsible for executing some async tasks like linux crontab.
onex-nightwatch/app/options
Package options contains flags and options for initializing an nightwatch.
Package options contains flags and options for initializing an nightwatch.
onex-pump
gateway is the backend portal of onex.
gateway is the backend portal of onex.
onex-pump/app/options
Package options contains flags and options for initializing an apiserver
Package options contains flags and options for initializing an apiserver
onex-toyblc
onex-toyblc is used to show a naive and simple blockchain.
onex-toyblc is used to show a naive and simple blockchain.
onex-toyblc/app/options
Package options contains flags and options for initializing an apiserver
Package options contains flags and options for initializing an apiserver
onex-usercenter
usercenter is the user center of the onex cloud platform.
usercenter is the user center of the onex cloud platform.
onex-usercenter/app/options
Package options contains flags and options for initializing an apiserver
Package options contains flags and options for initializing an apiserver
examples
internal
cacheserver/biz
Package biz is the place where you can implements more complex business logic.
Package biz is the place where you can implements more complex business logic.
cacheserver/biz/namespaced
Package namespaced is a generated GoMock package.
Package namespaced is a generated GoMock package.
cacheserver/biz/secret
Package secret is a generated GoMock package.
Package secret is a generated GoMock package.
cacheserver/store
Package store is a generated GoMock package.
Package store is a generated GoMock package.
controller
Package controller contains methods used by all controller.
Package controller contains methods used by all controller.
controller/chain
Package chain implements chain controller.
Package chain implements chain controller.
controller/miner
Package miner implements miner controller.
Package miner implements miner controller.
fakeserver/biz
Package biz is the place where you can implements more complex business logic.
Package biz is the place where you can implements more complex business logic.
fakeserver/biz/order
Package order is a generated GoMock package.
Package order is a generated GoMock package.
fakeserver/store
Package store defines the storage interface for fakeserver.
Package store defines the storage interface for fakeserver.
gateway/biz
Package biz is the place where you can implements more complex business logic.
Package biz is the place where you can implements more complex business logic.
gateway/biz/miner
Package miner is a generated GoMock package.
Package miner is a generated GoMock package.
gateway/biz/minerset
Package minerset is a generated GoMock package.
Package minerset is a generated GoMock package.
gateway/store
Package store is a generated GoMock package.
Package store is a generated GoMock package.
nightwatch/watcher
Package watcher provides functions used by all watchers.
Package watcher provides functions used by all watchers.
nightwatch/watcher/clean
Package clean is a watcher implement.
Package clean is a watcher implement.
nightwatch/watcher/secretsclean
Package secretsclean is a watcher implement used to delete expired keys from the database.
Package secretsclean is a watcher implement used to delete expired keys from the database.
onexctl
Package onexctl provides the functions used by the onexctl command line tool under github.com/superproj/onex/internal/onexctl/cmd.
Package onexctl provides the functions used by the onexctl command line tool under github.com/superproj/onex/internal/onexctl/cmd.
onexctl/cmd
Package cmd create a root cobra command and add subcommands to it.
Package cmd create a root cobra command and add subcommands to it.
onexctl/cmd/color
Package color print colors supported by the current terminal.
Package color print colors supported by the current terminal.
onexctl/cmd/info
Package info print the host information.
Package info print the host information.
onexctl/cmd/jwt
Package jwt can be used to sign/show/verify jwt token with given secretID and secretKey.
Package jwt can be used to sign/show/verify jwt token with given secretID and secretKey.
onexctl/cmd/minerset
Package minerset provides functions to manage minersets on onex platform.
Package minerset provides functions to manage minersets on onex platform.
onexctl/cmd/new
Package used to generate demo command code.
Package used to generate demo command code.
onexctl/cmd/options
Package options print a list of global command-line options (applies to all commands).
Package options print a list of global command-line options (applies to all commands).
onexctl/cmd/secret
Package secret provides functions to manage secrets on onex platform.
Package secret provides functions to manage secrets on onex platform.
onexctl/cmd/user
Package user provides functions to manage users on onex cloud platform.
Package user provides functions to manage users on onex cloud platform.
onexctl/cmd/validate
Package validate is used to validate the basic environment for onexctl to run.
Package validate is used to validate the basic environment for onexctl to run.
onexctl/cmd/version
Package version print the client and server version information.
Package version print the client and server version information.
onexctl/util/interrupt
Package interrupt deal with signals.
Package interrupt deal with signals.
onexctl/util/templates
Package templates provides template functions for working with templates.
Package templates provides template functions for working with templates.
onexctl/util/term
Package term provides structures and helper functions to work with terminal (state, sizes).
Package term provides structures and helper functions to work with terminal (state, sizes).
pkg/client/store
Package store defines the storage interface for onex-gateway.
Package store defines the storage interface for onex-gateway.
pkg/client/usercenter
Package usercenter provide methods used to access usercenter service.
Package usercenter provide methods used to access usercenter service.
pkg/client/usercenter.consul
Package usercenter provide methods used to access usercenter service.
Package usercenter provide methods used to access usercenter service.
pkg/contract
Package contract provides support for the ClusterReconciler to handle with providers objects according to the Cluster API contract.
Package contract provides support for the ClusterReconciler to handle with providers objects according to the Cluster API contract.
pkg/feature
Package feature implements feature functionality.
Package feature implements feature functionality.
pkg/ports
Package ports defines ports used by various pieces of the onex infrastructure.
Package ports defines ports used by various pieces of the onex infrastructure.
pkg/util/annotations
Package annotations implements annotation helper functions.
Package annotations implements annotation helper functions.
pkg/util/collections
Package collections implements collection utilities.
Package collections implements collection utilities.
pkg/util/conditions
Package conditions implements condition utilities.
Package conditions implements condition utilities.
pkg/util/contract
Package contract contains utils related to the Cluster API contract.
Package contract contains utils related to the Cluster API contract.
pkg/util/conversion
Package conversion implements conversion utilities.
Package conversion implements conversion utilities.
pkg/util/core
Package core implements core utilities.
Package core implements core utilities.
pkg/util/hash
Package hash provides utils to calculate hashes.
Package hash provides utils to calculate hashes.
pkg/util/labels
Package labels contains useful functions to process onex labels.
Package labels contains useful functions to process onex labels.
pkg/util/log
Package log provides log utils.
Package log provides log utils.
pkg/util/patch
Package patch implements patch utilities.
Package patch implements patch utilities.
pkg/util/predicates
Package predicates implements predicate utilities.
Package predicates implements predicate utilities.
pkg/util/ssa
Package ssa contains utils related to Server-Side-Apply.
Package ssa contains utils related to Server-Side-Apply.
pkg/util/yaml
Package yaml implements yaml utility functions.
Package yaml implements yaml utility functions.
registry/apps/chain
Package chain provides Registry interface and its RESTStorage implementation for storing Chain objects.
Package chain provides Registry interface and its RESTStorage implementation for storing Chain objects.
registry/apps/chain/storage
Package storage provides Registry interface and its REST implementation for storing chain api objects.
Package storage provides Registry interface and its REST implementation for storing chain api objects.
registry/apps/miner
Package miner provides Registry interface and its RESTStorage implementation for storing Miner objects.
Package miner provides Registry interface and its RESTStorage implementation for storing Miner objects.
registry/apps/miner/storage
Package storage provides Registry interface and its REST implementation for storing miner api objects.
Package storage provides Registry interface and its REST implementation for storing miner api objects.
registry/apps/minerset
Package minerset provides Registry interface and its RESTStorage implementation for storing Miner objects.
Package minerset provides Registry interface and its RESTStorage implementation for storing Miner objects.
registry/apps/minerset/storage
Package storage provides Registry interface and its REST implementation for storing minerset api objects.
Package storage provides Registry interface and its REST implementation for storing minerset api objects.
usercenter/auth
Package auth is a generated GoMock package.
Package auth is a generated GoMock package.
usercenter/biz
Package biz is the place where you can implements more complex business logic.
Package biz is the place where you can implements more complex business logic.
usercenter/biz/auth
Package auth is a generated GoMock package.
Package auth is a generated GoMock package.
usercenter/biz/secret
Package secret is a generated GoMock package.
Package secret is a generated GoMock package.
usercenter/biz/user
Package user is a generated GoMock package.
Package user is a generated GoMock package.
usercenter/store
Package store is a generated GoMock package.
Package store is a generated GoMock package.
pkg
api/fakeserver/v1
Package v1 is a reverse proxy.
Package v1 is a reverse proxy.
apis/apps
Package apps is the internal version of the API.
Package apps is the internal version of the API.
apis/apps/install
Package install installs the experimental API group, making it available as an option to all of the API encoding/decoding machinery.
Package install installs the experimental API group, making it available as an option to all of the API encoding/decoding machinery.
apis/apps/v1beta1
Package v1beta1 is the v1beta1 version of the API.
Package v1beta1 is the v1beta1 version of the API.
apis/apps/v1beta1/index
Package index provides indexes for the api.
Package index provides indexes for the api.
apis/coordination/install
Package install installs the coordination API group, making it available as an option to all of the API encoding/decoding machinery.
Package install installs the coordination API group, making it available as an option to all of the API encoding/decoding machinery.
apis/core
Package core contains the latest (or "internal") version of the OneX API objects.
Package core contains the latest (or "internal") version of the OneX API objects.
apis/core/install
Package install installs the v1 monolithic api, making it available as an option to all of the API encoding/decoding machinery.
Package install installs the v1 monolithic api, making it available as an option to all of the API encoding/decoding machinery.
apis/core/v1
Package v1 is the v1 version of the API.
Package v1 is the v1 version of the API.
app
cache
Package cache is a complete Go cache library that brings you multiple ways of managing your caches.
Package cache is a complete Go cache library that brings you multiple ways of managing your caches.
cli/genericclioptions
Package genericclioptions contains flags which can be added to you command, bound, completed, and produce useful helper functions.
Package genericclioptions contains flags which can be added to you command, bound, completed, and produce useful helper functions.
db
Package db provide useful functions to create mysql instance.
Package db provide useful functions to create mysql instance.
errors
Package errors makes a set of error message handlers available for use by cloud miner.
Package errors makes a set of error message handlers available for use by cloud miner.
generated/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
generated/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
generated/clientset/versioned/typed/apps/v1beta1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
generated/clientset/versioned/typed/apps/v1beta1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
generated/clientset/versioned/typed/coordination/v1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
generated/clientset/versioned/typed/coordination/v1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
generated/clientset/versioned/typed/core/v1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
generated/clientset/versioned/typed/core/v1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
id
log
Package log is a log package used by onex project.
Package log is a log package used by onex project.
options
Package options is the public flags and options used by a generic api server.
Package options is the public flags and options used by a generic api server.
record
Package record implements recording functionality.
Package record implements recording functionality.
streams
Package streams provides interfaces of the streaming library.
Package streams provides interfaces of the streaming library.
streams/connector/extension
Package extension provides basic connector implementations.
Package extension provides basic connector implementations.
streams/connector/kafka
Package kafka implements the Apache Kafka connector.
Package kafka implements the Apache Kafka connector.
streams/connector/redis
Package redis implements the Redis Pub/Sub connector.
Package redis implements the Redis Pub/Sub connector.
streams/util
Package util provides utility functions.
Package util provides utility functions.
streams/util/ospkg
Package ospkg provides platform-specific utility functions and constants.
Package ospkg provides platform-specific utility functions and constants.
streams/ws
Package ws implements the WebSocket connector.
Package ws implements the WebSocket connector.
util/lint
Package lint tests Go code for policy and style violations, as well as detecting suspicious constructs that are typically bugs.
Package lint tests Go code for policy and style violations, as well as detecting suspicious constructs that are typically bugs.
util/lint/hash
Package hash defines an Analyzer that detects correct use of hash.Hash.
Package hash defines an Analyzer that detects correct use of hash.Hash.
util/lint/pass
Package pass useful functionality for implementing passes.
Package pass useful functionality for implementing passes.
util/version
Package version provides utilities for version number comparisons
Package version provides utilities for version number comparisons
version
Package verflag defines utility functions to handle command line flags related to version of Kubernetes.
Package verflag defines utility functions to handle command line flags related to version of Kubernetes.
tools

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL