├── .gitignore ├── LICENSE ├── README.md ├── Zeus-Gateway ├── .idea │ ├── compiler.xml │ ├── encodings.xml │ ├── misc.xml │ └── workspace.xml ├── Zeus-Gateway.iml ├── pom.xml ├── zeus-core │ ├── pom.xml │ ├── src │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── antzuhl │ │ │ │ └── zeus │ │ │ │ ├── core │ │ │ │ ├── common │ │ │ │ │ ├── CatContext.java │ │ │ │ │ ├── Constants.java │ │ │ │ │ ├── ExecutionStatus.java │ │ │ │ │ ├── FilterInfo.java │ │ │ │ │ ├── HttpServletRequestWrapper.java │ │ │ │ │ ├── HttpServletResponseWrapper.java │ │ │ │ │ ├── IDynamicCodeCompiler.java │ │ │ │ │ ├── IFilterFactory.java │ │ │ │ │ ├── IFilterUsageNotifier.java │ │ │ │ │ ├── IMonitor.java │ │ │ │ │ ├── INamedCount.java │ │ │ │ │ ├── ITracer.java │ │ │ │ │ ├── IZeusFilter.java │ │ │ │ │ ├── IZeusFilterDao.java │ │ │ │ │ ├── IZeusFilterDaoBuilder.java │ │ │ │ │ ├── ServletInputStreamWrapper.java │ │ │ │ │ ├── ZeusException.java │ │ │ │ │ ├── ZeusFilterResult.java │ │ │ │ │ └── ZeusHeaders.java │ │ │ │ ├── context │ │ │ │ │ └── RequestContext.java │ │ │ │ ├── core │ │ │ │ │ ├── FilterFileManager.java │ │ │ │ │ ├── FilterLoader.java │ │ │ │ │ ├── FilterProcessor.java │ │ │ │ │ ├── LogConfigurator.java │ │ │ │ │ ├── ZeusCallable.java │ │ │ │ │ └── ZeusRunner.java │ │ │ │ ├── filters │ │ │ │ │ ├── DefaultFilterFactory.java │ │ │ │ │ ├── FilterRegistry.java │ │ │ │ │ ├── FilterScriptManagerServlet.java │ │ │ │ │ ├── FilterVerifier.java │ │ │ │ │ ├── HttpZeusFilterDao.java │ │ │ │ │ ├── HttpZeusFilterDaoBuilder.java │ │ │ │ │ ├── HystrixZeusFilterDao.java │ │ │ │ │ ├── JDBCZeusFilterDao.java │ │ │ │ │ ├── JDBCZeusFilterDaoBuilder.java │ │ │ │ │ ├── ZeusFilter.java │ │ │ │ │ ├── ZeusFilterDaoFactory.java │ │ │ │ │ └── ZeusFilterPoller.java │ │ │ │ ├── groovy │ │ │ │ │ ├── GroovyCompiler.java │ │ │ │ │ └── GroovyFileFilter.java │ │ │ │ ├── hystrix │ │ │ │ │ ├── DiscoveryServerList.java │ │ │ │ │ ├── HttpClientResponse.java │ │ │ │ │ ├── RestClient.java │ │ │ │ │ ├── RestClientFactory.java │ │ │ │ │ ├── RibbonRequestCommandForSemaphoreIsolation.java │ │ │ │ │ ├── RibbonRequestCommandForThreadIsolation.java │ │ │ │ │ ├── RibbonZeusCommon.java │ │ │ │ │ ├── ZeusCommandHelper.java │ │ │ │ │ ├── ZeusRequestCommandForSemaphoreIsolation.java │ │ │ │ │ └── ZeusRequestCommandForThreadIsolation.java │ │ │ │ ├── mobile │ │ │ │ │ ├── DebugHeader.java │ │ │ │ │ ├── DebugModeSetter.java │ │ │ │ │ ├── DebugRequest.java │ │ │ │ │ ├── DebugResponse.java │ │ │ │ │ ├── ErrorResponse.java │ │ │ │ │ ├── HealthCheck.java │ │ │ │ │ ├── MobileAddTimeStamp.java │ │ │ │ │ ├── MobileExecuteRoute.java │ │ │ │ │ ├── SendResponse.java │ │ │ │ │ ├── Stats.java │ │ │ │ │ └── TestRouting.java │ │ │ │ ├── monitoring │ │ │ │ │ ├── Counter.java │ │ │ │ │ ├── CounterFactory.java │ │ │ │ │ ├── ErrorStatsData.java │ │ │ │ │ ├── ErrorStatsManager.java │ │ │ │ │ ├── MetricPoller.java │ │ │ │ │ ├── MonitorRegistry.java │ │ │ │ │ ├── NamedCountingMonitor.java │ │ │ │ │ ├── RouteErrorMonitor.java │ │ │ │ │ ├── RouteStatusCodeMonitor.java │ │ │ │ │ ├── ServoMonitor.java │ │ │ │ │ ├── StatManager.java │ │ │ │ │ ├── Tracer.java │ │ │ │ │ └── TracerFactory.java │ │ │ │ ├── servlet │ │ │ │ │ └── CatServletFilter.java │ │ │ │ └── util │ │ │ │ │ ├── AdminFilterUtil.java │ │ │ │ │ ├── Debug.java │ │ │ │ │ ├── DeepCopy.java │ │ │ │ │ ├── HTTPRequestUtil.java │ │ │ │ │ ├── HttpUtil.java │ │ │ │ │ ├── IPUtil.java │ │ │ │ │ ├── JSONUtils.java │ │ │ │ │ ├── MonitoringUtil.java │ │ │ │ │ ├── S2gUtil.java │ │ │ │ │ ├── SleepUtil.java │ │ │ │ │ └── StringUtil.java │ │ │ │ └── tool │ │ │ │ ├── InfoBoard.java │ │ │ │ ├── common │ │ │ │ ├── AbstractHandler.java │ │ │ │ ├── ClassStats.java │ │ │ │ ├── GCStats.java │ │ │ │ ├── LogHandler.java │ │ │ │ ├── MemoryStats.java │ │ │ │ ├── OperatingSystemStats.java │ │ │ │ ├── Stats.java │ │ │ │ ├── StatsGetter.java │ │ │ │ ├── StatsHandler.java │ │ │ │ ├── StatusInfo.java │ │ │ │ └── ThreadStats.java │ │ │ │ ├── servlet │ │ │ │ ├── EnvServlet.java │ │ │ │ ├── HystrixServlet.java │ │ │ │ ├── PropsServlet.java │ │ │ │ ├── StaticServlet.java │ │ │ │ └── StatusServlet.java │ │ │ │ ├── stat │ │ │ │ ├── ClassStatsGetter.java │ │ │ │ ├── GCStatsGetter.java │ │ │ │ ├── JvmStatsReporter.java │ │ │ │ ├── MemoryStatsGetter.java │ │ │ │ ├── OperatingSystemStatsGetter.java │ │ │ │ └── ThreadStatsGetter.java │ │ │ │ └── util │ │ │ │ ├── ByteUtil.java │ │ │ │ └── TimeUtil.java │ │ │ └── resources │ │ │ └── content │ │ │ ├── index.html │ │ │ └── jquery-2.1.1.min.js │ └── zeus-core.iml ├── zeus-gateway │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── antzuhl │ │ │ └── zeus │ │ │ └── servlet │ │ │ ├── AsyncZeusListener.java │ │ │ ├── AsyncZeusServlet.java │ │ │ ├── InitializeServletListener.java │ │ │ └── SyncZeusServlet.java │ │ ├── resources │ │ ├── .gitignore │ │ ├── META-INF │ │ │ └── app.properties │ │ ├── db │ │ │ └── schema.sql │ │ ├── mobile_zeus-logback-prod.xml │ │ ├── mobile_zeus-logback-test.xml │ │ ├── mobile_zeus-logback-uat.xml │ │ └── mobile_zeus-logback.xml │ │ ├── scripts │ │ ├── error │ │ │ └── ErrorResponse.groovy │ │ ├── post │ │ │ ├── AddTimeStamp.groovy │ │ │ ├── DebugHeader.groovy │ │ │ ├── DebugResponse.groovy │ │ │ ├── SendResponse.groovy │ │ │ └── Stats.groovy │ │ ├── pre │ │ │ ├── DebugModeSetter.groovy │ │ │ ├── DebugRequest.groovy │ │ │ ├── HealthCheck.groovy │ │ │ └── TestRoute.groovy │ │ └── route │ │ │ ├── ExecuteRibbon.groovy │ │ │ └── ExecuteRoute.groovy │ │ └── webapp │ │ ├── WEB-INF │ │ └── web.xml │ │ └── admin │ │ └── filterLoader.jsp └── zeus-test-service │ ├── .gitignore │ ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── zeus │ │ │ └── test │ │ │ └── demo │ │ │ └── DemoApplication.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── zeus │ └── test │ └── demo │ └── DemoApplicationTests.java ├── images └── logo.png └── zeus-discovery ├── .idea ├── compiler.xml ├── libraries │ └── Java_EE_6_Java_EE_6.xml ├── misc.xml └── workspace.xml ├── doc ├── api │ ├── client │ │ ├── auditlog.js │ │ └── serviceAlive.js │ └── server │ │ ├── authserver.js │ │ └── serviceSearch.js ├── apidoc.json └── doc │ ├── api_data.js │ ├── api_data.json │ ├── api_project.js │ ├── api_project.json │ ├── css │ └── style.css │ ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 │ ├── img │ └── favicon.ico │ ├── index.html │ ├── locales │ ├── ca.js │ ├── cs.js │ ├── de.js │ ├── es.js │ ├── fr.js │ ├── it.js │ ├── locale.js │ ├── nl.js │ ├── pl.js │ ├── pt_br.js │ ├── ro.js │ ├── ru.js │ ├── tr.js │ ├── vi.js │ ├── zh.js │ └── zh_cn.js │ ├── main.js │ ├── utils │ ├── handlebars_helper.js │ └── send_sample_request.js │ └── vendor │ ├── bootstrap.min.css │ ├── bootstrap.min.js │ ├── diff_match_patch.min.js │ ├── handlebars.min.js │ ├── jquery.min.js │ ├── list.min.js │ ├── lodash.custom.min.js │ ├── path-to-regexp │ ├── LICENSE │ └── index.js │ ├── polyfill.js │ ├── prettify.css │ ├── prettify │ ├── lang-Splus.js │ ├── lang-aea.js │ ├── lang-agc.js │ ├── lang-apollo.js │ ├── lang-basic.js │ ├── lang-cbm.js │ ├── lang-cl.js │ ├── lang-clj.js │ ├── lang-css.js │ ├── lang-dart.js │ ├── lang-el.js │ ├── lang-erl.js │ ├── lang-erlang.js │ ├── lang-fs.js │ ├── lang-go.js │ ├── lang-hs.js │ ├── lang-lasso.js │ ├── lang-lassoscript.js │ ├── lang-latex.js │ ├── lang-lgt.js │ ├── lang-lisp.js │ ├── lang-ll.js │ ├── lang-llvm.js │ ├── lang-logtalk.js │ ├── lang-ls.js │ ├── lang-lsp.js │ ├── lang-lua.js │ ├── lang-matlab.js │ ├── lang-ml.js │ ├── lang-mumps.js │ ├── lang-n.js │ ├── lang-nemerle.js │ ├── lang-pascal.js │ ├── lang-proto.js │ ├── lang-r.js │ ├── lang-rd.js │ ├── lang-rkt.js │ ├── lang-rust.js │ ├── lang-s.js │ ├── lang-scala.js │ ├── lang-scm.js │ ├── lang-sql.js │ ├── lang-ss.js │ ├── lang-swift.js │ ├── lang-tcl.js │ ├── lang-tex.js │ ├── lang-vb.js │ ├── lang-vbs.js │ ├── lang-vhd.js │ ├── lang-vhdl.js │ ├── lang-wiki.js │ ├── lang-xq.js │ ├── lang-xquery.js │ ├── lang-yaml.js │ ├── lang-yml.js │ ├── prettify.css │ ├── prettify.js │ └── run_prettify.js │ ├── require.min.js │ ├── semver.min.js │ └── webfontloader.js ├── pom.xml ├── script ├── audit_log.sql ├── rpc_message.sql └── rpc_service.sql ├── zeus-auth ├── pom.xml └── zeus-auth.iml ├── zeus-code.iml ├── zeus-common ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── antzuhl │ │ └── zeus │ │ ├── dao │ │ └── ServiceInfoMapper.java │ │ ├── entity │ │ ├── AuditLog.java │ │ ├── RpcMessage.java │ │ ├── RpcService.java │ │ ├── Service.java │ │ ├── ServiceInfo.java │ │ ├── request │ │ │ ├── RpcRequest.java │ │ │ └── ServiceRequest.java │ │ └── response │ │ │ ├── LocalAuditLog.java │ │ │ ├── RpcResponse.java │ │ │ └── ServiceInfoResponce.java │ │ ├── result │ │ ├── GenericJsonResult.java │ │ ├── HResult.java │ │ └── IHResult.java │ │ └── utils │ │ ├── JSONDecoder.java │ │ └── JSONEncoder.java │ └── resources │ ├── generator │ └── generatorConfig.xml │ └── mapper │ └── ServiceInfoMapper.xml ├── zeus-core ├── pom.xml ├── src │ └── main │ │ ├── java │ │ └── com │ │ │ └── antzuhl │ │ │ └── zeus │ │ │ ├── annotation │ │ │ ├── AnnotationImport.java │ │ │ ├── RateLimit.java │ │ │ ├── RpcService.java │ │ │ └── ZeusProperty.java │ │ │ ├── api │ │ │ ├── ClientAuditLogController.java │ │ │ ├── ServiceAliveController.java │ │ │ └── response │ │ │ │ └── LocalAuditLog.java │ │ │ ├── beans │ │ │ └── AuditLog.java │ │ │ ├── client │ │ │ └── RpcClient.java │ │ │ ├── config │ │ │ ├── AutoConfiguration.java │ │ │ ├── InterceptorConfig.java │ │ │ └── ServerConfig.java │ │ │ ├── dao │ │ │ ├── AuditLogMapper.java │ │ │ ├── MapperFactory.java │ │ │ └── ServiceInfoMapper.java │ │ │ ├── event │ │ │ ├── ServiceDiscovery.java │ │ │ └── TaskApplicationListener.java │ │ │ ├── filter │ │ │ └── AuditLogInterceptor.java │ │ │ ├── framework │ │ │ ├── SpringContextUtil.java │ │ │ └── SqlResourceFactory.java │ │ │ ├── handler │ │ │ ├── NettyClientHandler.java │ │ │ └── NettyServerHandler.java │ │ │ ├── limit │ │ │ └── RateLimitFilter.java │ │ │ ├── properties │ │ │ ├── BeanUtils.java │ │ │ ├── PropertySourcesPlaceholderConfigurerBean.java │ │ │ └── RouteProperties.java │ │ │ ├── remote │ │ │ └── RpcClient.java │ │ │ └── server │ │ │ └── NettyServer.java │ │ └── resources │ │ ├── application.yml │ │ ├── generator │ │ └── generatorConfig.xml │ │ ├── mapper │ │ ├── AuditLogMapper.xml │ │ └── ServiceInfoMapper.xml │ │ └── myBatis-config.xml └── zeus-core.iml ├── zeus-example ├── pom.xml ├── src │ └── main │ │ ├── java │ │ └── com │ │ │ └── demo │ │ │ ├── DemoApplication.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ └── service │ │ │ ├── DoSomething.java │ │ │ └── DoSomethingImpl.java │ │ └── resources │ │ └── application.yml ├── target │ └── classes │ │ └── application.yml └── zeus-example.iml ├── zeus-rpc-example ├── pom.xml ├── src │ └── main │ │ ├── java │ │ └── com │ │ │ └── demo │ │ │ ├── RpcApplication.java │ │ │ └── controller │ │ │ └── UserController.java │ │ └── resources │ │ └── application.yml └── target │ └── classes │ └── application.yml ├── zeus-server ├── pom.xml ├── src │ └── main │ │ ├── java │ │ └── com │ │ │ └── antzuhl │ │ │ └── zeus │ │ │ ├── ZeusServerApplication.java │ │ │ ├── api │ │ │ ├── AuditLogController.java │ │ │ ├── ServiceController.java │ │ │ ├── request │ │ │ │ └── ServiceRequest.java │ │ │ └── response │ │ │ │ └── ServiceInfoResponce.java │ │ │ ├── beans │ │ │ ├── AuditLog.java │ │ │ └── Service.java │ │ │ ├── config │ │ │ ├── SQLiteDialect.java │ │ │ ├── SQLiteDialectIdentityColumnSupport.java │ │ │ ├── ServiceAliveTask.java │ │ │ └── ZeusApplicationListener.java │ │ │ ├── oauth │ │ │ ├── OAuth2AuthorizationServer.java │ │ │ ├── OAuth2ResourceServer.java │ │ │ └── SecurityConfig.java │ │ │ └── registory │ │ │ ├── AuditLogRegistory.java │ │ │ └── ServiceRegistory.java │ │ └── resources │ │ ├── application.yml │ │ └── log4j.properties ├── target │ ├── classes │ │ ├── application.yml │ │ └── log4j.properties │ └── maven-status │ │ └── maven-compiler-plugin │ │ └── compile │ │ └── default-compile │ │ ├── createdFiles.lst │ │ └── inputFiles.lst └── zeus-server.iml ├── zeus.sqlite3 └── zeus2.sqlite3 /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | 7 | # BlueJ files 8 | *.ctxt 9 | 10 | # Mobile Tools for Java (J2ME) 11 | .mtj.tmp/ 12 | 13 | # Package Files # 14 | *.jar 15 | *.war 16 | *.nar 17 | *.ear 18 | *.zip 19 | *.tar.gz 20 | *.rar 21 | 22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 23 | hs_err_pid* 24 | -------------------------------------------------------------------------------- /Zeus-Gateway/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | -------------------------------------------------------------------------------- /Zeus-Gateway/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Zeus-Gateway/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Zeus-Gateway/Zeus-Gateway.iml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/common/CatContext.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.common; 2 | 3 | import com.dianping.cat.Cat; 4 | 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | public class CatContext implements Cat.Context { 9 | private Map properties = new HashMap(); 10 | 11 | @Override 12 | public void addProperty(String key, String value) { 13 | this.properties.put(key, value); 14 | } 15 | 16 | @Override 17 | public String getProperty(String key) { 18 | return this.properties.get(key); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/common/ExecutionStatus.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.common; 2 | 3 | public enum ExecutionStatus { 4 | 5 | SUCCESS(1), SKIPPED(-1), DISABLED(-2), FAILED(-3); 6 | 7 | private int status; 8 | 9 | ExecutionStatus(int status) { 10 | this.status = status; 11 | } 12 | } -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/common/HttpServletResponseWrapper.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.common; 2 | 3 | import javax.servlet.http.HttpServletResponse; 4 | 5 | public class HttpServletResponseWrapper extends javax.servlet.http.HttpServletResponseWrapper { 6 | private int status = 0; 7 | 8 | public HttpServletResponseWrapper(HttpServletResponse response) { 9 | super(response); 10 | } 11 | 12 | @Override 13 | public void setStatus(int sc) { 14 | this.status = sc; 15 | super.setStatus(sc); 16 | } 17 | 18 | @Override 19 | public void setStatus(int sc, String sm) { 20 | this.status = sc; 21 | super.setStatus(sc, sm); 22 | } 23 | 24 | public int getStatus() { 25 | return status; 26 | } 27 | } -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/common/IDynamicCodeCompiler.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.common; 2 | 3 | import java.io.File; 4 | 5 | 6 | /** 7 | * Interface to generate Classes from source code 8 | */ 9 | public interface IDynamicCodeCompiler { 10 | Class compile(String sCode, String sName) throws Exception; 11 | 12 | Class compile(File file) throws Exception; 13 | } -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/common/IFilterFactory.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.common; 2 | 3 | import com.antzuhl.zeus.core.filters.ZeusFilter; 4 | 5 | /** 6 | * Interface to provide instances of ZeusFilter from a given class. 7 | */ 8 | public interface IFilterFactory { 9 | 10 | /** 11 | * Returns an instance of the specified class. 12 | * 13 | * @param clazz 14 | * the Class to instantiate 15 | * @return an instance of ZeusFilter 16 | * @throws Exception 17 | * if an error occurs 18 | */ 19 | public ZeusFilter newInstance(Class clazz) throws Exception; 20 | } -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/common/IFilterUsageNotifier.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.common; 2 | 3 | import com.antzuhl.zeus.core.filters.ZeusFilter; 4 | 5 | /** 6 | * Interface to implement for registering a callback for each time a filter 7 | * is used. 8 | * 9 | */ 10 | public interface IFilterUsageNotifier { 11 | public void notify(ZeusFilter filter, ExecutionStatus status); 12 | } 13 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/common/IMonitor.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.common; 2 | 3 | public interface IMonitor { 4 | /** 5 | * Implement this to add this Counter to a Registry 6 | * @param monitorObj 7 | */ 8 | void register(INamedCount monitorObj); 9 | } 10 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/common/INamedCount.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.common; 2 | 3 | public interface INamedCount { 4 | 5 | public String getName(); 6 | public long getCount(); 7 | 8 | } -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/common/ITracer.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.common; 2 | /** 3 | * Time based monitoring metric. 4 | * 5 | */ 6 | public interface ITracer { 7 | 8 | /** 9 | * Stops and Logs a time based tracer 10 | * 11 | */ 12 | void stopAndLog(); 13 | 14 | /** 15 | * Sets the name for the time based tracer 16 | * 17 | * @param name a String value 18 | */ 19 | void setName(String name); 20 | 21 | } -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/common/IZeusFilter.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.common; 2 | 3 | public interface IZeusFilter { 4 | 5 | /** 6 | * a "true" return from this method means that the run() method should be invoked 7 | * 8 | * @return true if the run() method should be invoked. false will not invoke the run() method 9 | */ 10 | boolean shouldFilter(); 11 | 12 | /** 13 | * if shouldFilter() is true, this method will be invoked. this method is the core method of a ZeusFilter 14 | * 15 | * @return Some arbitrary artifact may be returned. Current implementation ignores it. 16 | */ 17 | Object run() throws ZeusException; 18 | 19 | } -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/common/IZeusFilterDaoBuilder.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.common; 2 | 3 | public interface IZeusFilterDaoBuilder { 4 | IZeusFilterDao build(); 5 | } 6 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/common/ServletInputStreamWrapper.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.common; 2 | 3 | import javax.servlet.ServletInputStream; 4 | import java.io.IOException; 5 | 6 | /** 7 | * ServletInputStream wrapper to wrap a byte[] into a ServletInputStream 8 | * 9 | */ 10 | public class ServletInputStreamWrapper extends ServletInputStream { 11 | 12 | private byte[] data; 13 | private int idx = 0; 14 | 15 | /** 16 | * Creates a new ServletInputStreamWrapper instance. 17 | * 18 | * @param data a byte[] value 19 | */ 20 | public ServletInputStreamWrapper(byte[] data) { 21 | if (data == null) 22 | data = new byte[0]; 23 | this.data = data; 24 | } 25 | 26 | @Override 27 | public int read() throws IOException { 28 | if (idx == data.length) 29 | return -1; 30 | // I have to AND the byte with 0xff in order to ensure that it is returned as an unsigned integer 31 | // the lack of this was causing a weird bug when manually unzipping gzipped request bodies 32 | return data[idx++] & 0xff; 33 | } 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/common/ZeusException.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.common; 2 | /** 3 | * All handled exceptions in Zeus are ZeusExceptions 4 | */ 5 | public class ZeusException extends Exception { 6 | public int nStatusCode; 7 | public String errorCause; 8 | 9 | /** 10 | * Source Throwable, message, status code and info about the cause 11 | * @param throwable 12 | * @param sMessage 13 | * @param nStatusCode 14 | * @param errorCause 15 | */ 16 | public ZeusException(Throwable throwable, String sMessage, int nStatusCode, String errorCause) { 17 | super(sMessage, throwable); 18 | this.nStatusCode = nStatusCode; 19 | this.errorCause = errorCause; 20 | } 21 | 22 | /** 23 | * error message, status code and info about the cause 24 | * @param sMessage 25 | * @param nStatusCode 26 | * @param errorCause 27 | */ 28 | public ZeusException(String sMessage, int nStatusCode, String errorCause) { 29 | super(sMessage); 30 | this.nStatusCode = nStatusCode; 31 | this.errorCause = errorCause; 32 | } 33 | 34 | /** 35 | * Source Throwable, status code and info about the cause 36 | * @param throwable 37 | * @param nStatusCode 38 | * @param errorCause 39 | */ 40 | public ZeusException(Throwable throwable, int nStatusCode, String errorCause) { 41 | super(throwable.getMessage(), throwable); 42 | this.nStatusCode = nStatusCode; 43 | this.errorCause = errorCause; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/common/ZeusFilterResult.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.common; 2 | 3 | public final class ZeusFilterResult { 4 | 5 | private Object result; 6 | private Throwable exception; 7 | private ExecutionStatus status; 8 | 9 | public ZeusFilterResult(Object result, ExecutionStatus status) { 10 | this.result = result; 11 | this.status = status; 12 | } 13 | 14 | public ZeusFilterResult(ExecutionStatus status) { 15 | this.status = status; 16 | } 17 | 18 | public ZeusFilterResult() { 19 | this.status = ExecutionStatus.DISABLED; 20 | } 21 | 22 | /** 23 | * @return the result 24 | */ 25 | public Object getResult() { 26 | return result; 27 | } 28 | 29 | /** 30 | * @param result 31 | * the result to set 32 | */ 33 | public void setResult(Object result) { 34 | this.result = result; 35 | } 36 | 37 | /** 38 | * @return the status 39 | */ 40 | public ExecutionStatus getStatus() { 41 | return status; 42 | } 43 | 44 | /** 45 | * @param status 46 | * the status to set 47 | */ 48 | public void setStatus(ExecutionStatus status) { 49 | this.status = status; 50 | } 51 | 52 | /** 53 | * @return the exception 54 | */ 55 | public Throwable getException() { 56 | return exception; 57 | } 58 | 59 | /** 60 | * @param exception 61 | * the exception to set 62 | */ 63 | public void setException(Throwable exception) { 64 | this.exception = exception; 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/common/ZeusHeaders.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.common; 2 | 3 | /** 4 | * HTTP Headers 5 | */ 6 | public class ZeusHeaders { 7 | public static final String TRANSFER_ENCODING = "transfer-encoding"; 8 | public static final String CHUNKED = "chunked"; 9 | public static final String CONTENT_ENCODING = "content-encoding"; 10 | public static final String CONTENT_LENGTH = "content-length"; 11 | public static final String ACCEPT_ENCODING = "accept-encoding"; 12 | public static final String CONNECTION = "connection"; 13 | public static final String KEEP_ALIVE = "keep-alive"; 14 | public static final String HOST = "host"; 15 | public static final String X_FORWARDED_PROTO = "x-forwarded-proto"; 16 | public static final String X_FORWARDED_FOR = "x-forwarded-for"; 17 | 18 | public static final String X_ZEUS = "x-zeus"; 19 | public static final String X_ZEUS_INSTANCE = "x-zeus-instance"; 20 | public static final String X_ORIGINATING_URL = "x-originating-url"; 21 | public static final String X_ZEUS_ERROR_CAUSE = "x-zeus-error-cause"; 22 | public static final String X_ZEUS_CLIENT_HOST = "x-zeus-client-host"; 23 | public static final String X_ZEUS_CLIENT_PROTO = "x-zeus-client-proto"; 24 | public static final String X_ZEUS_SURGICAL_FILTER = "x-zeus-surgical-filter"; 25 | public static final String X_ZEUS_FILTER_EXECUTION_STATUS = "x-zeus-filter-executions"; 26 | public static final String X_ZEUS_REQUEST_TOPLEVEL_ID = "x-zeus-request.toplevel.uuid"; 27 | } -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/filters/DefaultFilterFactory.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.filters; 2 | 3 | 4 | import com.antzuhl.zeus.core.common.IFilterFactory; 5 | 6 | /** 7 | * Default factory for creating instances of ZeusFilter. 8 | */ 9 | public class DefaultFilterFactory implements IFilterFactory { 10 | 11 | /** 12 | * Returns a new implementation of ZeusFilter as specified by the provided 13 | * Class. The Class is instantiated using its nullary constructor. 14 | * 15 | * @param clazz the Class to instantiate 16 | * @return A new instance of ZeusFilter 17 | */ 18 | @Override 19 | public ZeusFilter newInstance(Class clazz) throws InstantiationException, IllegalAccessException { 20 | return (ZeusFilter) clazz.newInstance(); 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/filters/FilterRegistry.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.filters; 2 | 3 | import java.util.Collection; 4 | import java.util.concurrent.ConcurrentHashMap; 5 | 6 | public class FilterRegistry { 7 | 8 | private static final FilterRegistry instance = new FilterRegistry(); 9 | 10 | public static final FilterRegistry instance() { 11 | return instance; 12 | } 13 | 14 | private final ConcurrentHashMap filters = new ConcurrentHashMap(); 15 | 16 | private FilterRegistry() { 17 | } 18 | 19 | public ZeusFilter remove(String key) { 20 | return this.filters.remove(key); 21 | } 22 | 23 | public ZeusFilter get(String key) { 24 | return this.filters.get(key); 25 | } 26 | 27 | public void put(String key, ZeusFilter filter) { 28 | this.filters.putIfAbsent(key, filter); 29 | } 30 | 31 | public int size() { 32 | return this.filters.size(); 33 | } 34 | 35 | public Collection getAllFilters() { 36 | return this.filters.values(); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/filters/HttpZeusFilterDaoBuilder.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.filters; 2 | 3 | import com.antzuhl.zeus.core.common.Constants; 4 | import com.antzuhl.zeus.core.common.IZeusFilterDao; 5 | import com.antzuhl.zeus.core.common.IZeusFilterDaoBuilder; 6 | import com.netflix.config.DynamicPropertyFactory; 7 | import com.netflix.config.DynamicStringProperty; 8 | 9 | public class HttpZeusFilterDaoBuilder implements IZeusFilterDaoBuilder { 10 | 11 | private static final DynamicStringProperty appName = DynamicPropertyFactory.getInstance() 12 | .getStringProperty(Constants.DEPLOYMENT_APPLICATION_ID, Constants.APPLICATION_NAME); 13 | 14 | public HttpZeusFilterDaoBuilder() { 15 | 16 | } 17 | 18 | @Override 19 | public IZeusFilterDao build() { 20 | return new HttpZeusFilterDao(appName.get()); 21 | 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/filters/ZeusFilterDaoFactory.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.filters; 2 | 3 | import com.antzuhl.zeus.core.common.Constants; 4 | import com.antzuhl.zeus.core.common.IZeusFilterDao; 5 | import com.google.common.collect.Maps; 6 | import com.netflix.config.DynamicPropertyFactory; 7 | import com.netflix.config.DynamicStringProperty; 8 | 9 | import java.util.concurrent.ConcurrentMap; 10 | 11 | public class ZeusFilterDaoFactory { 12 | private static final DynamicStringProperty daoType = DynamicPropertyFactory.getInstance().getStringProperty(Constants.ZEUS_FILTER_DAO_TYPE, "jdbc"); 13 | 14 | private static ConcurrentMap daoCache = Maps.newConcurrentMap(); 15 | 16 | private ZeusFilterDaoFactory(){ 17 | 18 | } 19 | 20 | public static IZeusFilterDao getZeusFilterDao(){ 21 | IZeusFilterDao dao = daoCache.get(daoType.get()); 22 | 23 | if(dao != null){ 24 | return dao; 25 | } 26 | 27 | if("jdbc".equalsIgnoreCase(daoType.get())){ 28 | dao = new JDBCZeusFilterDaoBuilder().build(); 29 | }else if("http".equalsIgnoreCase(daoType.get())){ 30 | dao = new HttpZeusFilterDaoBuilder().build(); 31 | }else{ 32 | dao = new HttpZeusFilterDaoBuilder().build(); 33 | } 34 | 35 | daoCache.putIfAbsent(daoType.get(), dao); 36 | 37 | return dao; 38 | } 39 | 40 | public static String getCurrentType(){ 41 | return daoType.get(); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/groovy/GroovyCompiler.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.groovy; 2 | 3 | import com.antzuhl.zeus.core.common.IDynamicCodeCompiler; 4 | import groovy.lang.GroovyClassLoader; 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | 8 | import java.io.File; 9 | import java.io.IOException; 10 | 11 | /** 12 | * Groovy code compiler 13 | */ 14 | public class GroovyCompiler implements IDynamicCodeCompiler { 15 | 16 | private static final Logger LOGGER = LoggerFactory.getLogger(GroovyCompiler.class); 17 | 18 | /** 19 | * Compiles Groovy code and returns the Class of the compiles code. 20 | * 21 | * @param sCode 22 | * @param sName 23 | * @return 24 | */ 25 | public Class compile(String sCode, String sName) { 26 | GroovyClassLoader loader = getGroovyClassLoader(); 27 | LOGGER.warn("Compiling filter: " + sName); 28 | Class groovyClass = loader.parseClass(sCode, sName); 29 | return groovyClass; 30 | } 31 | 32 | /** 33 | * @return a new GroovyClassLoader 34 | */ 35 | GroovyClassLoader getGroovyClassLoader() { 36 | return new GroovyClassLoader(); 37 | } 38 | 39 | /** 40 | * Compiles groovy class from a file 41 | * 42 | * @param file 43 | * @return 44 | * @throws IOException 45 | */ 46 | public Class compile(File file) throws IOException { 47 | GroovyClassLoader loader = getGroovyClassLoader(); 48 | Class groovyClass = loader.parseClass(file); 49 | return groovyClass; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/groovy/GroovyFileFilter.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.groovy; 2 | 3 | import java.io.File; 4 | import java.io.FilenameFilter; 5 | 6 | /** 7 | * Filters only .groovy files 8 | */ 9 | public class GroovyFileFilter implements FilenameFilter { 10 | public boolean accept(File dir, String name) { 11 | return name.endsWith(".groovy"); 12 | } 13 | } -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/hystrix/RibbonRequestCommandForSemaphoreIsolation.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.hystrix; 2 | 3 | import com.netflix.client.AbstractLoadBalancerAwareClient; 4 | import com.netflix.client.http.HttpRequest; 5 | import com.netflix.hystrix.HystrixCommand; 6 | import com.netflix.hystrix.HystrixCommandGroupKey; 7 | import com.netflix.hystrix.HystrixCommandKey; 8 | import com.netflix.hystrix.HystrixCommandProperties; 9 | 10 | public class RibbonRequestCommandForSemaphoreIsolation extends RibbonZeusCommon { 11 | 12 | 13 | 14 | public RibbonRequestCommandForSemaphoreIsolation(AbstractLoadBalancerAwareClient client,HttpRequest request, String serviceName, String commandGroup, 15 | String commandKey) { 16 | super(client,request, serviceName, commandGroup, commandKey, 17 | HystrixCommand.Setter.withGroupKey(HystrixCommandGroupKey.Factory.asKey(commandGroup)) 18 | .andCommandKey(HystrixCommandKey.Factory.asKey(commandKey)) 19 | .andCommandPropertiesDefaults(HystrixCommandProperties.Setter().withExecutionIsolationStrategy( 20 | HystrixCommandProperties.ExecutionIsolationStrategy.SEMAPHORE))); 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/hystrix/RibbonRequestCommandForThreadIsolation.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.hystrix; 2 | 3 | import com.netflix.client.AbstractLoadBalancerAwareClient; 4 | import com.netflix.client.http.HttpRequest; 5 | import com.netflix.hystrix.HystrixCommandGroupKey; 6 | import com.netflix.hystrix.HystrixCommandKey; 7 | import com.netflix.hystrix.HystrixCommandProperties; 8 | import com.netflix.hystrix.HystrixThreadPoolKey; 9 | 10 | public class RibbonRequestCommandForThreadIsolation extends RibbonZeusCommon { 11 | 12 | public RibbonRequestCommandForThreadIsolation(AbstractLoadBalancerAwareClient client,HttpRequest request, String serviceName, String commandGroup, 13 | String commandKey, String threadPoolKey) { 14 | super(client,request, serviceName, commandGroup, commandKey, 15 | Setter.withGroupKey(HystrixCommandGroupKey.Factory.asKey(commandGroup)) 16 | .andCommandKey(HystrixCommandKey.Factory.asKey(commandKey)) 17 | .andThreadPoolKey(HystrixThreadPoolKey.Factory.asKey(threadPoolKey)) 18 | .andCommandPropertiesDefaults(HystrixCommandProperties.Setter().withExecutionIsolationStrategy( 19 | HystrixCommandProperties.ExecutionIsolationStrategy.THREAD))); 20 | 21 | } 22 | 23 | public RibbonRequestCommandForThreadIsolation(AbstractLoadBalancerAwareClient client,HttpRequest request, String serviceName, String commandGroup, 24 | String commandKey) { 25 | this(client,request, serviceName, commandGroup, 26 | commandKey, ZeusCommandHelper.getThreadPoolKey(commandGroup,commandKey)); 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/mobile/HealthCheck.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.mobile; 2 | 3 | import com.antzuhl.zeus.core.context.RequestContext; 4 | import com.antzuhl.zeus.core.filters.ZeusFilter; 5 | import javax.servlet.http.HttpServletResponse; 6 | 7 | public class HealthCheck extends ZeusFilter { 8 | 9 | @Override 10 | public String filterType() { 11 | return "pre"; 12 | } 13 | 14 | public String uri() { 15 | return "/healthcheck"; 16 | } 17 | 18 | @Override 19 | public boolean shouldFilter() { 20 | String path = RequestContext.getCurrentContext().getRequest().getRequestURI(); 21 | return path.equalsIgnoreCase(uri()); 22 | } 23 | 24 | public int filterOrder(){ 25 | return 0; 26 | } 27 | 28 | public String responseBody() { 29 | return "ok"; 30 | } 31 | 32 | @Override 33 | public Object run() { 34 | RequestContext ctx = RequestContext.getCurrentContext(); 35 | // Set the default response code for static filters to be 200 36 | ctx.getResponse().setStatus(HttpServletResponse.SC_OK); 37 | ctx.getResponse().setContentType("application/xml"); 38 | // first StaticResponseFilter instance to match wins, others do not set body and/or status 39 | if (ctx.getResponseBody() == null) { 40 | ctx.setResponseBody(responseBody()); 41 | ctx.setSendZeusResponse(false); 42 | } 43 | return null; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/mobile/MobileAddTimeStamp.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.mobile; 2 | 3 | import com.antzuhl.zeus.core.common.ZeusException; 4 | import com.antzuhl.zeus.core.context.RequestContext; 5 | import com.antzuhl.zeus.core.filters.ZeusFilter; 6 | 7 | public class MobileAddTimeStamp extends ZeusFilter { 8 | 9 | private final static int TIMESTAMP_EXPIRED_SECS = 600; 10 | 11 | @Override 12 | public String filterType() { 13 | return "post"; 14 | } 15 | 16 | @Override 17 | public boolean shouldFilter() { 18 | return true; 19 | } 20 | @Override 21 | public int filterOrder() { 22 | return 30; 23 | 24 | } 25 | @Override 26 | public Object run() throws ZeusException { 27 | RequestContext.getCurrentContext().addZeusResponseHeader("X-S2G-TIMESTAMP", String.valueOf(System.currentTimeMillis()/1000)); 28 | return true; 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/mobile/Stats.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.mobile; 2 | 3 | import com.antzuhl.zeus.core.context.RequestContext; 4 | import com.antzuhl.zeus.core.filters.ZeusFilter; 5 | import com.antzuhl.zeus.core.monitoring.StatManager; 6 | 7 | public class Stats extends ZeusFilter { 8 | @Override 9 | public String filterType() { 10 | return "post"; 11 | } 12 | 13 | @Override 14 | public int filterOrder() { 15 | return 20000; 16 | } 17 | 18 | @Override 19 | public boolean shouldFilter() { 20 | return true; 21 | } 22 | 23 | @Override 24 | public Object run() { 25 | RequestContext ctx = RequestContext.getCurrentContext(); 26 | int status = ctx.getResponseStatusCode(); 27 | StatManager sm = StatManager.getManager(); 28 | sm.collectRequestStats(ctx.getRequest()); 29 | sm.collectRouteStatusStats(ctx.getRouteName(), status); 30 | return null; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/monitoring/Counter.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.monitoring; 2 | 3 | import com.netflix.servo.DefaultMonitorRegistry; 4 | import com.netflix.servo.monitor.BasicCounter; 5 | import com.netflix.servo.monitor.MonitorConfig; 6 | import com.netflix.servo.tag.InjectableTag; 7 | import com.netflix.servo.tag.Tag; 8 | 9 | import java.util.ArrayList; 10 | import java.util.List; 11 | import java.util.concurrent.ConcurrentHashMap; 12 | import java.util.concurrent.ConcurrentMap; 13 | 14 | /** 15 | * Plugin to hook up a Servo counter to the CounterFactory 16 | */ 17 | public class Counter extends CounterFactory { 18 | final static ConcurrentMap map = new ConcurrentHashMap(); 19 | final Object lock = new Object(); 20 | 21 | @Override 22 | public void increment(String name) { 23 | BasicCounter counter = getCounter(name); 24 | counter.increment(); 25 | } 26 | 27 | private BasicCounter getCounter(String name) { 28 | BasicCounter counter = map.get(name); 29 | if (counter == null) { 30 | synchronized (lock) { 31 | counter = map.get(name); 32 | if (counter != null) { 33 | return counter; 34 | } 35 | 36 | List tags = new ArrayList(2); 37 | tags.add(InjectableTag.HOSTNAME); 38 | tags.add(InjectableTag.IP); 39 | counter = new BasicCounter(MonitorConfig.builder(name).withTags(tags).build()); 40 | map.putIfAbsent(name, counter); 41 | DefaultMonitorRegistry.getInstance().register(counter); 42 | } 43 | } 44 | return counter; 45 | } 46 | } -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/monitoring/CounterFactory.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.monitoring; 2 | 3 | /** 4 | * Abstraction layer to provide counter based monitoring. 5 | * 6 | */ 7 | public abstract class CounterFactory { 8 | 9 | private static CounterFactory instance; 10 | 11 | /** 12 | * Pass in a CounterFactory Instance. This must be done to use Zeus as Zeus uses several internal counters 13 | * 14 | * @param f a CounterFactory value 15 | */ 16 | public static final void initialize(CounterFactory f) { 17 | instance = f; 18 | } 19 | 20 | /** 21 | * return the singleton CounterFactory instance. 22 | * 23 | * @return a CounterFactory value 24 | */ 25 | public static final CounterFactory instance() { 26 | if(instance == null) throw new IllegalStateException(String.format("%s not initialized", CounterFactory.class.getSimpleName())); 27 | return instance; 28 | } 29 | 30 | /** 31 | * Increments the counter of the given name 32 | * 33 | * @param name a String value 34 | */ 35 | public abstract void increment(String name); 36 | 37 | } -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/monitoring/MetricPoller.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.monitoring; 2 | 3 | import com.netflix.servo.publish.*; 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | 7 | import java.io.File; 8 | import java.io.IOException; 9 | import java.util.concurrent.TimeUnit; 10 | 11 | /** 12 | * Sample poller to poll metrics using Servo's metric publication 13 | */ 14 | public class MetricPoller { 15 | 16 | private static Logger LOG = LoggerFactory.getLogger(MetricPoller.class); 17 | 18 | final static PollScheduler scheduler = PollScheduler.getInstance(); 19 | 20 | public static void startPoller(){ 21 | scheduler.start(); 22 | final int heartbeatInterval = 1200; 23 | 24 | final File metricsDir; 25 | try { 26 | metricsDir = File.createTempFile("zeus-servo-metrics-", ""); 27 | metricsDir.delete(); 28 | metricsDir.mkdir(); 29 | } catch (IOException e) { 30 | throw new RuntimeException(e); 31 | } 32 | 33 | LOG.debug("created metrics dir " + metricsDir.getAbsolutePath()); 34 | 35 | MetricObserver transform = new CounterToRateMetricTransform( 36 | new FileMetricObserver("ZeusMetrics", metricsDir), 37 | heartbeatInterval, TimeUnit.SECONDS); 38 | 39 | PollRunnable task = new PollRunnable( 40 | new MonitorRegistryMetricPoller(), 41 | BasicMetricFilter.MATCH_ALL, 42 | transform); 43 | 44 | final int samplingInterval = 10; 45 | scheduler.addPoller(task, samplingInterval, TimeUnit.SECONDS); 46 | 47 | } 48 | 49 | } -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/monitoring/MonitorRegistry.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.monitoring; 2 | 3 | import com.antzuhl.zeus.core.common.IMonitor; 4 | import com.antzuhl.zeus.core.common.INamedCount; 5 | 6 | public class MonitorRegistry { 7 | 8 | private static final MonitorRegistry instance = new MonitorRegistry(); 9 | private IMonitor publisher; 10 | 11 | /** 12 | * A Monitor implementation should be set here 13 | * @param publisher 14 | */ 15 | public void setPublisher(IMonitor publisher) { 16 | this.publisher = publisher; 17 | } 18 | 19 | 20 | 21 | public static MonitorRegistry getInstance() { 22 | return instance; 23 | } 24 | 25 | public void registerObject(INamedCount monitorObj) { 26 | if(publisher != null) publisher.register(monitorObj); 27 | } 28 | } -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/monitoring/NamedCountingMonitor.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.monitoring; 2 | 3 | import com.antzuhl.zeus.core.common.INamedCount; 4 | import com.netflix.servo.annotations.DataSourceType; 5 | import com.netflix.servo.annotations.Monitor; 6 | import com.netflix.servo.annotations.MonitorTags; 7 | import com.netflix.servo.tag.BasicTagList; 8 | import com.netflix.servo.tag.TagList; 9 | 10 | import java.util.concurrent.atomic.AtomicLong; 11 | 12 | public class NamedCountingMonitor implements INamedCount { 13 | 14 | private final String name; 15 | 16 | @MonitorTags 17 | TagList tagList; 18 | @Monitor(name = "count", type = DataSourceType.COUNTER) 19 | private final AtomicLong count = new AtomicLong(); 20 | 21 | public NamedCountingMonitor(String name) { 22 | this.name = name; 23 | tagList = BasicTagList.of("ID", name); 24 | } 25 | 26 | /** 27 | * reguisters this objects 28 | * 29 | * @return 30 | */ 31 | public NamedCountingMonitor register() { 32 | MonitorRegistry.getInstance().registerObject(this); 33 | return this; 34 | } 35 | 36 | /** 37 | * increments the counter 38 | * 39 | * @return 40 | */ 41 | public long increment() { 42 | return this.count.incrementAndGet(); 43 | } 44 | 45 | @Override 46 | public String getName() { 47 | return name; 48 | } 49 | 50 | /** 51 | * @return the current count 52 | */ 53 | public long getCount() { 54 | return this.count.get(); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/monitoring/ServoMonitor.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.monitoring; 2 | 3 | import com.antzuhl.zeus.core.common.IMonitor; 4 | import com.antzuhl.zeus.core.common.INamedCount; 5 | import com.netflix.servo.monitor.Monitors; 6 | 7 | public class ServoMonitor implements IMonitor { 8 | @Override 9 | public void register(INamedCount monitorObj) { 10 | Monitors.registerObject(monitorObj); 11 | } 12 | } -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/monitoring/Tracer.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.monitoring; 2 | 3 | import com.antzuhl.zeus.core.common.ITracer; 4 | import com.netflix.servo.monitor.DynamicTimer; 5 | import com.netflix.servo.monitor.MonitorConfig; 6 | import com.netflix.servo.monitor.Stopwatch; 7 | import com.netflix.servo.tag.InjectableTag; 8 | import com.netflix.servo.tag.Tag; 9 | 10 | import java.util.ArrayList; 11 | import java.util.List; 12 | import java.util.concurrent.TimeUnit; 13 | 14 | public class Tracer extends TracerFactory { 15 | 16 | static List tags = new ArrayList(2); 17 | 18 | static { 19 | tags.add(InjectableTag.HOSTNAME); 20 | tags.add(InjectableTag.IP); 21 | } 22 | 23 | @Override 24 | public ITracer startMicroTracer(String name) { 25 | return new ServoTracer(name); 26 | } 27 | 28 | class ServoTracer implements ITracer { 29 | 30 | final MonitorConfig config; 31 | final Stopwatch stopwatch; 32 | 33 | private ServoTracer(String name) { 34 | config = MonitorConfig.builder(name).withTags(tags).build(); 35 | stopwatch = DynamicTimer.start(config, TimeUnit.MICROSECONDS); 36 | } 37 | 38 | @Override 39 | public void stopAndLog() { 40 | DynamicTimer.record(config, stopwatch.getDuration()); 41 | } 42 | 43 | @Override 44 | public void setName(String name) { 45 | 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/monitoring/TracerFactory.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.monitoring; 2 | 3 | 4 | import com.antzuhl.zeus.core.common.ITracer; 5 | 6 | /** 7 | * Abstraction layer to provide time-based monitoring. 8 | * 9 | */ 10 | public abstract class TracerFactory { 11 | 12 | private static TracerFactory instance; 13 | 14 | /** 15 | * sets a TracerFactory Implementation 16 | * 17 | * @param f a TracerFactory value 18 | */ 19 | public static final void initialize(TracerFactory f) { 20 | instance = f; 21 | } 22 | 23 | 24 | /** 25 | * Returns the singleton TracerFactory 26 | * 27 | * @return a TracerFactory value 28 | */ 29 | public static final TracerFactory instance() { 30 | if(instance == null) throw new IllegalStateException(String.format("%s not initialized", TracerFactory.class.getSimpleName())); 31 | return instance; 32 | } 33 | 34 | public abstract ITracer startMicroTracer(String name); 35 | 36 | } -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/util/DeepCopy.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.util; 2 | 3 | import java.io.*; 4 | 5 | public class DeepCopy { 6 | /** 7 | * Returns a copy of the object, or null if the object cannot be serialized. 8 | * 9 | * @param orig 10 | * an Object value 11 | * @return a deep copy of that Object 12 | * @exception NotSerializableException 13 | * if an error occurs 14 | */ 15 | public static Object copy(Object orig) throws NotSerializableException { 16 | Object obj = null; 17 | try { 18 | // Write the object out to a byte array 19 | ByteArrayOutputStream bos = new ByteArrayOutputStream(); 20 | ObjectOutputStream out = new ObjectOutputStream(bos); 21 | out.writeObject(orig); 22 | out.flush(); 23 | out.close(); 24 | 25 | // Make an input stream from the byte array and read 26 | // a copy of the object back in. 27 | ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())); 28 | obj = in.readObject(); 29 | } catch (NotSerializableException e) { 30 | throw e; 31 | } catch (IOException e) { 32 | e.printStackTrace(); 33 | } catch (ClassNotFoundException cnfe) { 34 | cnfe.printStackTrace(); 35 | } 36 | return obj; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/util/HttpUtil.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.util; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import com.alibaba.fastjson.serializer.SerializerFeature; 5 | import org.apache.http.HttpEntity; 6 | import org.apache.http.client.ClientProtocolException; 7 | import org.apache.http.client.methods.CloseableHttpResponse; 8 | import org.apache.http.client.methods.HttpPost; 9 | import org.apache.http.entity.StringEntity; 10 | import org.apache.http.impl.client.CloseableHttpClient; 11 | import org.apache.http.util.EntityUtils; 12 | 13 | import java.io.IOException; 14 | import java.nio.charset.Charset; 15 | import java.util.Map; 16 | 17 | public class HttpUtil { 18 | 19 | 20 | public static T postData(CloseableHttpClient httpClient,String url, Object par, Map header, Class clazz) 21 | throws ClientProtocolException, IOException { 22 | HttpPost method = new HttpPost(url); 23 | method.setHeader("Content-type", "application/json; charset=utf-8"); 24 | method.setHeader("Accept", "application/json"); 25 | if (header != null) { 26 | for (String key : header.keySet()) { 27 | method.setHeader(key, header.get(key)); 28 | } 29 | } 30 | if (par != null) { 31 | String parameters = JSON.toJSONString(par, SerializerFeature.DisableCircularReferenceDetect); 32 | HttpEntity entity = new StringEntity(parameters, Charset.forName("UTF-8")); 33 | method.setEntity(entity); 34 | } 35 | CloseableHttpResponse response = httpClient.execute(method); 36 | String body = EntityUtils.toString(response.getEntity()); 37 | return JSON.parseObject(body, clazz); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/util/MonitoringUtil.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.util; 2 | 3 | import com.antzuhl.zeus.core.common.ITracer; 4 | import com.antzuhl.zeus.core.monitoring.CounterFactory; 5 | import com.antzuhl.zeus.core.monitoring.TracerFactory; 6 | 7 | /** 8 | * Dummy implementations of CounterFactory, TracerFactory, and Tracer 9 | */ 10 | public class MonitoringUtil { 11 | 12 | public static final void initMocks() { 13 | CounterFactory.initialize(new CounterFactoryImpl()); 14 | TracerFactory.initialize(new TracerFactoryImpl()); 15 | } 16 | 17 | private static final class CounterFactoryImpl extends CounterFactory { 18 | @Override 19 | public void increment(String name) {} 20 | } 21 | 22 | private static final class TracerFactoryImpl extends TracerFactory { 23 | @Override 24 | public ITracer startMicroTracer(String name) { 25 | return new TracerImpl(); 26 | } 27 | } 28 | 29 | private static final class TracerImpl implements ITracer { 30 | @Override 31 | public void setName(String name) {} 32 | 33 | @Override 34 | public void stopAndLog() {} 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/util/S2gUtil.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.util; 2 | 3 | import org.apache.commons.lang.StringUtils; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | import java.util.Arrays; 7 | import java.util.List; 8 | 9 | public class S2gUtil { 10 | public static boolean contains(String[] srcTags, String[] dstTags) { 11 | if (dstTags == null || dstTags.length == 0) 12 | return true; 13 | 14 | if (srcTags == null || srcTags.length == 0) 15 | return false; 16 | 17 | List srcTagList = Arrays.asList(srcTags); 18 | for (String t : dstTags) { 19 | if (!srcTagList.contains(t)) { 20 | return false; 21 | } 22 | } 23 | return true; 24 | } 25 | public static String trimEnd(String data,char trim){ 26 | data=StringUtils.trim(data); 27 | if (!StringUtils.isEmpty(data)&& (data.toCharArray()[data.length() - 1]) == trim) { 28 | data = data.substring(0, data.length() - 1); 29 | } 30 | return data; 31 | } 32 | public static String getServerletUrl(HttpServletRequest request) { 33 | //String url= request.getServletPath(); 34 | String uri = request.getRequestURI(); 35 | String contextPath = request.getContextPath(); 36 | if (StringUtils.length(contextPath) > 0) { 37 | uri = StringUtils.substring(uri, contextPath.length()); 38 | } 39 | if(StringUtils.length(uri) > 0){ 40 | uri=uri.substring(1, StringUtils.length(uri)); 41 | } 42 | String query= request.getQueryString(); 43 | if(!StringUtils.isEmpty(query)){ 44 | uri+="?"+query; 45 | } 46 | return uri; 47 | } 48 | public static String[] getRoutes(HttpServletRequest request) { 49 | return getServerletUrl(request).split("/"); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/util/SleepUtil.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.util; 2 | 3 | public class SleepUtil { 4 | 5 | private SleepUtil() { 6 | } 7 | 8 | public static void sleep(long timeout) { 9 | try { 10 | Thread.sleep(timeout); 11 | } catch (Throwable t) { 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/core/util/StringUtil.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.core.util; 2 | 3 | import org.apache.commons.lang.StringUtils; 4 | 5 | import java.util.Arrays; 6 | import java.util.List; 7 | 8 | public class StringUtil { 9 | 10 | public static boolean contains(String[] srcTags, String[] dstTags) { 11 | if (dstTags == null || dstTags.length == 0) 12 | return true; 13 | 14 | if (srcTags == null || srcTags.length == 0) 15 | return false; 16 | 17 | List srcTagList = Arrays.asList(srcTags); 18 | for (String t : dstTags) { 19 | if (!srcTagList.contains(t)) { 20 | return false; 21 | } 22 | } 23 | return true; 24 | } 25 | 26 | public static String trimEnd(String data, char trim) { 27 | data = StringUtils.trim(data); 28 | if (!StringUtils.isEmpty(data) && (data.toCharArray()[data.length() - 1]) == trim) { 29 | data = data.substring(0, data.length() - 1); 30 | } 31 | return data; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/tool/common/AbstractHandler.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.tool.common; 2 | 3 | 4 | 5 | public abstract class AbstractHandler implements StatsHandler { 6 | @Override 7 | public void process(Stats stats) { 8 | if(stats == null) return; 9 | 10 | if(stats instanceof ClassStats) processClassStats((ClassStats) stats); 11 | else if(stats instanceof ThreadStats) processThreadStats((ThreadStats) stats); 12 | else if(stats instanceof MemoryStats) processMemoryStats((MemoryStats) stats); 13 | else if(stats instanceof GCStats) processGCStats((GCStats) stats); 14 | else if(stats instanceof OperatingSystemStats) processOperatingSystemStats((OperatingSystemStats) stats); 15 | } 16 | 17 | protected abstract void processGCStats(GCStats stats); 18 | 19 | protected abstract void processMemoryStats(MemoryStats stats); 20 | 21 | protected abstract void processThreadStats(ThreadStats stats); 22 | 23 | protected abstract void processClassStats(ClassStats stats); 24 | 25 | protected abstract void processOperatingSystemStats(OperatingSystemStats stats); 26 | } 27 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/tool/common/LogHandler.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.tool.common; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | 6 | 7 | public class LogHandler implements StatsHandler { 8 | private Logger logger = LoggerFactory.getLogger(this.getClass()); 9 | 10 | @Override 11 | public void process(Stats stats) { 12 | logger.info(stats.toString()); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/tool/common/Stats.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.tool.common; 2 | 3 | 4 | public interface Stats { 5 | String toJsonStr(); 6 | } 7 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/tool/common/StatsGetter.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.tool.common; 2 | 3 | 4 | public interface StatsGetter { 5 | 6 | Stats get(); 7 | } 8 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/tool/common/StatsHandler.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.tool.common; 2 | 3 | 4 | public interface StatsHandler { 5 | void process(Stats stats); 6 | } 7 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/tool/common/StatusInfo.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.tool.common; 2 | 3 | public class StatusInfo extends AbstractHandler{ 4 | volatile GCStats gcStats = new GCStats(); 5 | volatile MemoryStats memoryStats = new MemoryStats(); 6 | volatile ThreadStats threadStats = new ThreadStats(); 7 | volatile ClassStats classStats = new ClassStats(); 8 | volatile OperatingSystemStats systemStats = new OperatingSystemStats(); 9 | 10 | public GCStats getGCStats(){ 11 | return this.gcStats; 12 | } 13 | 14 | @Override 15 | protected void processGCStats(GCStats gcStats) { 16 | this.gcStats = gcStats; 17 | } 18 | 19 | @Override 20 | protected void processMemoryStats(MemoryStats memoryStats) { 21 | this.memoryStats = memoryStats; 22 | } 23 | 24 | @Override 25 | protected void processThreadStats(ThreadStats threadStats) { 26 | this.threadStats = threadStats; 27 | } 28 | 29 | @Override 30 | protected void processClassStats(ClassStats classStats) { 31 | this.classStats = classStats; 32 | } 33 | 34 | @Override 35 | protected void processOperatingSystemStats(OperatingSystemStats operatingSystemStats) { 36 | this.systemStats = operatingSystemStats; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/tool/servlet/EnvServlet.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.tool.servlet; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import org.eclipse.jetty.server.Response; 5 | 6 | import javax.servlet.ServletException; 7 | import javax.servlet.http.HttpServlet; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | import java.io.IOException; 11 | import java.io.PrintWriter; 12 | import java.util.Map; 13 | import java.util.TreeMap; 14 | 15 | public class EnvServlet extends HttpServlet{ 16 | 17 | @Override 18 | protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { 19 | 20 | // make a writable copy of the immutable System.getenv() map 21 | Map envVarsMap = new TreeMap(System.getenv()); 22 | 23 | String jsonStr = JSON.toJSONString(envVarsMap); 24 | 25 | resp.addHeader("Access-Control-Allow-Origin", "*"); 26 | resp.addHeader("Access-Control-Allow-Headers","Content-Type, Accept"); 27 | resp.setContentType("application/json; charset=UTF-8"); 28 | 29 | PrintWriter writer = resp.getWriter(); 30 | try{ 31 | writer.write(jsonStr); 32 | resp.setStatus(Response.SC_OK); 33 | } finally { 34 | if (writer != null) { 35 | writer.close(); 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/tool/stat/ClassStatsGetter.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.tool.stat; 2 | 3 | import com.antzuhl.zeus.tool.common.ClassStats; 4 | import com.antzuhl.zeus.tool.common.Stats; 5 | import com.antzuhl.zeus.tool.common.StatsGetter; 6 | 7 | import java.lang.management.ClassLoadingMXBean; 8 | import java.lang.management.ManagementFactory; 9 | 10 | 11 | public class ClassStatsGetter implements StatsGetter { 12 | ClassLoadingMXBean bean = ManagementFactory.getClassLoadingMXBean(); 13 | @Override 14 | public Stats get() { 15 | ClassStats s = new ClassStats(); 16 | s.setCurrentClassCount(bean.getLoadedClassCount()); 17 | s.setBeenLoadedClassCount(bean.getTotalLoadedClassCount()); 18 | s.setBeenUnloadedClassCount(bean.getUnloadedClassCount()); 19 | return s; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/tool/stat/MemoryStatsGetter.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.tool.stat; 2 | 3 | import com.antzuhl.zeus.tool.common.MemoryStats; 4 | import com.antzuhl.zeus.tool.common.Stats; 5 | import com.antzuhl.zeus.tool.common.StatsGetter; 6 | import java.lang.management.ManagementFactory; 7 | import java.lang.management.MemoryMXBean; 8 | import java.lang.management.MemoryUsage; 9 | 10 | 11 | public class MemoryStatsGetter implements StatsGetter { 12 | MemoryMXBean bean = ManagementFactory.getMemoryMXBean(); 13 | 14 | @Override 15 | public Stats get() { 16 | MemoryStats s = new MemoryStats(); 17 | 18 | MemoryUsage u = bean.getHeapMemoryUsage(); 19 | s.setHeapCommitedMemory(u.getCommitted()); 20 | s.setHeapUsedMemory(u.getUsed()); 21 | s.setHeapMaxMemory(u.getMax()); 22 | 23 | u = bean.getNonHeapMemoryUsage(); 24 | s.setNonHeapCommitedMemory(u.getCommitted()); 25 | s.setNonHeapUsedMemory(u.getUsed()); 26 | s.setNonHeapMaxMemory(u.getMax()); 27 | 28 | return s; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/tool/stat/ThreadStatsGetter.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.tool.stat; 2 | 3 | import com.antzuhl.zeus.tool.common.Stats; 4 | import com.antzuhl.zeus.tool.common.StatsGetter; 5 | import com.antzuhl.zeus.tool.common.ThreadStats; 6 | 7 | import java.lang.management.ManagementFactory; 8 | import java.lang.management.ThreadMXBean; 9 | 10 | 11 | public class ThreadStatsGetter implements StatsGetter { 12 | ThreadMXBean bean = ManagementFactory.getThreadMXBean(); 13 | 14 | @Override 15 | public Stats get() { 16 | ThreadStats s = new ThreadStats(); 17 | s.setCurrentThreadCount(bean.getThreadCount()); 18 | s.setDaemonThreadCount(bean.getDaemonThreadCount()); 19 | s.setBeenCreatedThreadCount(bean.getTotalStartedThreadCount()); 20 | return s; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/tool/util/ByteUtil.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.tool.util; 2 | 3 | public class ByteUtil { 4 | 5 | public static String bytesToSize(long bytes) { 6 | long kilobyte = 1024; 7 | long megabyte = kilobyte * 1024; 8 | long gigabyte = megabyte * 1024; 9 | long terabyte = gigabyte * 1024; 10 | 11 | if ((bytes >= 0) && (bytes < kilobyte)) { 12 | return bytes + " B"; 13 | 14 | } else if ((bytes >= kilobyte) && (bytes < megabyte)) { 15 | return String.format("%.0f", (double) bytes / kilobyte) + " KB"; 16 | 17 | } else if ((bytes >= megabyte) && (bytes < gigabyte)) { 18 | return String.format("%.2f", (double)bytes / megabyte) + " MB"; 19 | 20 | } else if ((bytes >= gigabyte) && (bytes < terabyte)) { 21 | return String.format("%.2f", (double)bytes / gigabyte) + " GB"; 22 | 23 | } else if (bytes >= terabyte) { 24 | return String.format("%.2f", (double)bytes / terabyte) + " TB"; 25 | 26 | } else { 27 | return bytes + " B"; 28 | } 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/src/main/java/com/antzuhl/zeus/tool/util/TimeUtil.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.tool.util; 2 | 3 | public class TimeUtil { 4 | 5 | public static String readableTimeInterval(long uptime) { 6 | long year = uptime/(1000*60*60*24*365); 7 | long month = (uptime%(1000*60*60*24*365))/(1000*60*60*24*30); 8 | long day = ((uptime%(1000*60*60*24*365))%(1000*60*60*24*30))/(1000*60*60*24); 9 | long hour = (uptime%(1000*60*60*24))/(1000*60*60); 10 | long minute = (uptime%(1000*60*60))/(1000*60); 11 | long second = (uptime%(1000*60))/(1000); 12 | 13 | StringBuilder builder = new StringBuilder(" "); 14 | if(year > 0) builder.append(year).append(year>1?" Years " : " Year "); 15 | if(month > 0) builder.append(month).append(month>1?" Months " : " Month "); 16 | if(day > 0) builder.append(day).append(day>1?" Days " : " Day "); 17 | if(hour > 0) builder.append(hour).append(hour>1?" Hours " : " Hour "); 18 | if(minute > 0) builder.append(minute).append(minute>1?" Minutes " : " Minute "); 19 | if(second > 0) builder.append(second).append(second>1?" Seconds " : " Second "); 20 | 21 | return builder.toString(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-core/zeus-core.iml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-gateway/src/main/java/com/antzuhl/zeus/servlet/AsyncZeusListener.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.servlet; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | 6 | import javax.servlet.AsyncEvent; 7 | import javax.servlet.AsyncListener; 8 | import javax.servlet.http.HttpServletRequest; 9 | import java.io.IOException; 10 | 11 | public class AsyncZeusListener implements AsyncListener { 12 | private static final Logger LOGGER = LoggerFactory.getLogger(AsyncZeusListener.class); 13 | 14 | @Override 15 | public void onComplete(AsyncEvent event) throws IOException { 16 | } 17 | 18 | @Override 19 | public void onTimeout(AsyncEvent event) throws IOException { 20 | LOGGER.error("Access {} timeout in AsyncServlet.", ((HttpServletRequest)event.getAsyncContext().getRequest()).getRequestURL()); 21 | } 22 | 23 | @Override 24 | public void onError(AsyncEvent event) throws IOException { 25 | LOGGER.error("Error while access {} in AsyncServlet.", ((HttpServletRequest)event.getAsyncContext().getRequest()).getRequestURL()); 26 | } 27 | 28 | @Override 29 | public void onStartAsync(AsyncEvent event) throws IOException { 30 | } 31 | } -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-gateway/src/main/resources/.gitignore: -------------------------------------------------------------------------------- 1 | /mobile_zeus.properties 2 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-gateway/src/main/resources/META-INF/app.properties: -------------------------------------------------------------------------------- 1 | app.name=mobile-zeus-gateway -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-gateway/src/main/resources/db/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `zeus_filter` ( 2 | `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键ID', 3 | `filter_id` varchar(45) DEFAULT NULL COMMENT '过滤器id', 4 | `revision` int(11) DEFAULT NULL COMMENT '版本', 5 | `create_time` datetime DEFAULT NULL COMMENT '创建时间', 6 | `is_active` tinyint(1) DEFAULT '0' COMMENT '是否是活跃', 7 | `is_canary` tinyint(1) DEFAULT '0' COMMENT '是否是灰度', 8 | `filter_code` longtext COMMENT 'filter代码', 9 | `filter_type` varchar(45) DEFAULT NULL COMMENT 'filter类型', 10 | `filter_name` varchar(45) DEFAULT NULL COMMENT '名称', 11 | `disable_property_name` varchar(45) DEFAULT NULL COMMENT '禁用属性', 12 | `filter_order` varchar(45) DEFAULT NULL COMMENT '顺序', 13 | `application_name` varchar(45) DEFAULT NULL COMMENT '应用名称', 14 | PRIMARY KEY (`id`) 15 | ) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8; 16 | 17 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-gateway/src/main/resources/mobile_zeus-logback-prod.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | %date [%thread] %-5level %logger{80}- %msg%n 10 | 11 | 12 | 13 | 14 | 15 | ${LOG_DIR}/${LOG_FILE_NAME} 16 | 17 | 18 | ${LOG_DIR}/${LOG_FILE_NAME}.%d{yyyy-MM-dd}.%i 19 | 21 | 22 | 100MB 23 | 24 | 30 25 | 26 | 27 | %date [%-5thread] %-5level [%-10logger] %-10msg%n 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-gateway/src/main/resources/mobile_zeus-logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | %date [%thread] %-5level %logger{80}- %msg%n 10 | 11 | 12 | 13 | 14 | 15 | ${LOG_DIR}/${LOG_FILE_NAME} 16 | 17 | 18 | ${LOG_DIR}/${LOG_FILE_NAME}.%d{yyyy-MM-dd}.%i 19 | 21 | 22 | 100MB 23 | 24 | 30 25 | 26 | 27 | %date [%-5thread] %-5level [%-10logger] %-10msg%n 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-gateway/src/main/resources/mobile_zeus-logback-uat.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | %date [%thread] %-5level %logger{80}- %msg%n 10 | 11 | 12 | 13 | 14 | 15 | ${LOG_DIR}/${LOG_FILE_NAME} 16 | 17 | 18 | ${LOG_DIR}/${LOG_FILE_NAME}.%d{yyyy-MM-dd}.%i 19 | 21 | 22 | 100MB 23 | 24 | 30 25 | 26 | 27 | %date [%-5thread] %-5level [%-10logger] %-10msg%n 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-gateway/src/main/resources/mobile_zeus-logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | %date [%thread] %-5level %logger{80}- %msg%n 10 | 11 | 12 | 13 | 14 | 15 | ${LOG_DIR}/${LOG_FILE_NAME} 16 | 17 | 18 | ${LOG_DIR}/${LOG_FILE_NAME}.%d{yyyy-MM-dd}.%i 19 | 21 | 22 | 100MB 23 | 24 | 30 25 | 26 | 27 | %date [%-5thread] %-5level [%-10logger] %-10msg%n 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-gateway/src/main/scripts/post/AddTimeStamp.groovy: -------------------------------------------------------------------------------- 1 | package scripts.post 2 | 3 | import com.antzuhl.zeus.core.common.ZeusException; 4 | import com.antzuhl.zeus.core.context.RequestContext; 5 | import com.antzuhl.zeus.core.filters.ZeusFilter; 6 | 7 | public class AddTimeStamp extends ZeusFilter { 8 | 9 | private final static int TIMESTAMP_EXPIRED_SECS = 600; 10 | 11 | @Override 12 | public String filterType() { 13 | return "post"; 14 | } 15 | 16 | @Override 17 | public boolean shouldFilter() { 18 | return true; 19 | } 20 | @Override 21 | public int filterOrder() { 22 | return 1; 23 | 24 | } 25 | @Override 26 | public Object run() throws ZeusException { 27 | long time = System.currentTimeMillis()/1000; 28 | RequestContext.getCurrentContext().addZeusResponseHeader("X-S2G-TIMESTAMP", String.valueOf(time)); 29 | return true; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-gateway/src/main/scripts/post/Stats.groovy: -------------------------------------------------------------------------------- 1 | package scripts.post 2 | 3 | import com.antzuhl.zeus.core.context.RequestContext 4 | import com.antzuhl.zeus.core.filters.ZeusFilter 5 | import com.antzuhl.zeus.core.monitoring.StatManager 6 | 7 | class Stats extends ZeusFilter { 8 | @Override 9 | String filterType() { 10 | return "post" 11 | } 12 | 13 | @Override 14 | int filterOrder() { 15 | return 20000 16 | } 17 | 18 | @Override 19 | boolean shouldFilter() { 20 | return true 21 | } 22 | 23 | @Override 24 | Object run() { 25 | RequestContext ctx = RequestContext.getCurrentContext(); 26 | int status = ctx.getResponseStatusCode(); 27 | StatManager sm = StatManager.manager 28 | sm.collectRequestStats(ctx.getRequest()); 29 | sm.collectRouteStatusStats(ctx.routeName, status); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-gateway/src/main/scripts/pre/DebugModeSetter.groovy: -------------------------------------------------------------------------------- 1 | package scripts.pre 2 | 3 | import com.netflix.config.DynamicBooleanProperty 4 | import com.netflix.config.DynamicPropertyFactory 5 | import com.netflix.config.DynamicStringProperty 6 | import com.antzuhl.zeus.core.context.RequestContext 7 | import com.antzuhl.zeus.core.filters.ZeusFilter 8 | 9 | class DebugModeSetter extends ZeusFilter { 10 | 11 | static final DynamicBooleanProperty couldSetDebug = 12 | DynamicPropertyFactory.getInstance().getBooleanProperty("zeus.could.set.debug", true); 13 | static final DynamicBooleanProperty debugRequest = 14 | DynamicPropertyFactory.getInstance().getBooleanProperty("zeus.debug.request", false); 15 | static final DynamicStringProperty debugParameter = 16 | DynamicPropertyFactory.getInstance().getStringProperty("zeus.debug.parameter", "debugRequest"); 17 | 18 | @Override 19 | String filterType() { 20 | return 'pre' 21 | } 22 | 23 | @Override 24 | int filterOrder() { 25 | return -100; 26 | } 27 | 28 | boolean shouldFilter() { 29 | if (!couldSetDebug.get()) { 30 | return false 31 | } 32 | if ("true".equals(RequestContext.currentContext.getRequest().getParameter(debugParameter.get()))) return true; 33 | return debugRequest.get(); 34 | } 35 | 36 | Object run() { 37 | RequestContext.getCurrentContext().setDebugRequest(true) 38 | RequestContext.getCurrentContext().setDebugRouting(true) 39 | return null; 40 | } 41 | } 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-gateway/src/main/scripts/pre/HealthCheck.groovy: -------------------------------------------------------------------------------- 1 | package scripts.pre 2 | 3 | import javax.servlet.http.HttpServletResponse 4 | 5 | import com.netflix.config.DynamicBooleanProperty 6 | import com.netflix.config.DynamicPropertyFactory 7 | import com.antzuhl.zeus.core.context.RequestContext 8 | import com.antzuhl.zeus.core.filters.ZeusFilter 9 | 10 | public class HealthCheck extends ZeusFilter{ 11 | @Override 12 | public String filterType() { 13 | return "pre"; 14 | } 15 | 16 | public Object uri() { 17 | return "/healthcheck"; 18 | } 19 | 20 | @Override 21 | boolean shouldFilter() { 22 | String path = RequestContext.currentContext.getRequest().getRequestURI() 23 | return path.equalsIgnoreCase(uri())||path.toLowerCase().endsWith(uri()); 24 | } 25 | 26 | public int filterOrder(){ 27 | return 0; 28 | } 29 | 30 | public String responseBody() { 31 | return "ok"; 32 | } 33 | 34 | @Override 35 | Object run() { 36 | RequestContext ctx = RequestContext.getCurrentContext(); 37 | // Set the default response code for static filters to be 200 38 | ctx.getResponse().setStatus(HttpServletResponse.SC_OK); 39 | ctx.getResponse().setContentType('application/xml') 40 | // first StaticResponseFilter instance to match wins, others do not set body and/or status 41 | if (ctx.getResponseBody() == null) { 42 | ctx.setResponseBody(responseBody()) 43 | ctx.sendZeusResponse(false); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-test-service/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-test-service/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CasterWx/Zeus/4187c50f13aa3ea041d60677a17fb147fe42100e/Zeus-Gateway/zeus-test-service/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-test-service/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-test-service/src/main/java/com/zeus/test/demo/DemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.zeus.test.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.web.bind.annotation.PathVariable; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | import javax.websocket.server.PathParam; 10 | import java.util.Date; 11 | 12 | @SpringBootApplication 13 | @RestController 14 | public class DemoApplication { 15 | 16 | public static void main(String[] args) { 17 | SpringApplication.run(DemoApplication.class, args); 18 | } 19 | 20 | @RequestMapping("/getUserDetail/{name}") 21 | public String getUserDetail(@PathVariable(name = "name") String name) { 22 | System.out.println("yes"); 23 | return "User:"+name + ","+new Date().getTime(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-test-service/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=9700 -------------------------------------------------------------------------------- /Zeus-Gateway/zeus-test-service/src/test/java/com/zeus/test/demo/DemoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.zeus.test.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class DemoApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CasterWx/Zeus/4187c50f13aa3ea041d60677a17fb147fe42100e/images/logo.png -------------------------------------------------------------------------------- /zeus-discovery/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /zeus-discovery/.idea/libraries/Java_EE_6_Java_EE_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /zeus-discovery/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /zeus-discovery/doc/api/client/serviceAlive.js: -------------------------------------------------------------------------------- 1 | /** 2 | @api {POST} /zeus/service/ping ping 3 | @apiName Service 4 | @apiGroup Service 5 | @apiVersion 1.0.0 6 | 7 | @apiHeader {String} Device-Info-Zeus EXAMPLE: {"netType": 1, "appType": 2, "clientType": 2, "deviceName":"iphone 7", "osVersion":"ios 13.1", "appVersion":"18.8.1", "imei":"","mac":"", "idfa":"A9E9752D-66B2-4E17-9C3A-FC1CC57D8F58"} 8 | 9 | @apiExample {curl} Example usage: 10 | curl -X POST 11 | https://api.zeus.com/zeus/service/ping 12 | -H 'Accept: application/json' 13 | -H 'Authorization-ZS: eyJraWQiOiIwIiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJuaWNrIjoi5p2O54Oo6Z2ZIiwiYXBwVHlwZSI6MiwibmFtZSI6ImRlbW9fbGl5ZWppbmdfc3R1ZGVudCIsImV4cCI6MTU0NTAxMTE5NywianRpIjoiMTAwIn0.eHuSRgId6Qk5J7q699lWGz4mwTCNZhDpaS6bYvWU-uE' 14 | -H 'Content-Type: application/json' 15 | -H 'User-Agent-QS: ZEUS' 16 | 17 | @apiSuccessExample {json} Success-Response: 18 | { 19 | "code":200, 20 | "message":"服务存活", 21 | "data":{ 22 | "serviceId":null, 23 | "serviceName":"domain", 24 | "serviceAddr":"47.35.124.54", 25 | "living":1, 26 | "comment":"订单服务" 27 | } 28 | } 29 | */ 30 | -------------------------------------------------------------------------------- /zeus-discovery/doc/api/server/authserver.js: -------------------------------------------------------------------------------- 1 | /** 2 | @api {POST} /oauth/token getToken 3 | @apiName token 4 | @apiGroup token 5 | @apiVersion 1.0.0 6 | 7 | @apiExample {curl} Example usage: 8 | curl -X POST 9 | --user user:password 10 | -D "username=user1&password=123456&grant_type=password&scope=read write" 11 | https://api.zeus.com/oauth/token 12 | -H 'Accept: application/x-www-form-urlencoded' 13 | 14 | @apiParam {String} username 用户名 15 | @apiParam {String} password 密码 16 | @apiParam {String} grant_type token类型 17 | @apiParam {String} scope 权限 18 | 19 | 20 | @apiSuccessExample {json} Success-Response: 21 | { 22 | "access_token": "620e5f04-5ae1-4bca-99f2-a16c4614fade", 23 | "token_type": "bearer", 24 | "refresh_token": "171b085c-0383-4308-8dd4-19117aeb73d0", 25 | "expires_in": 3599, 26 | "scope": "read write" 27 | } 28 | 29 | @apiErrorExample {json} Error-Response: 30 | { 31 | "timestamp": "2020-04-08T09:48:29.751+0000", 32 | "status": 401, 33 | "error": "Unauthorized", 34 | "message": "Unauthorized", 35 | "path": "/oauth/token" 36 | } 37 | */ 38 | -------------------------------------------------------------------------------- /zeus-discovery/doc/api/server/serviceSearch.js: -------------------------------------------------------------------------------- 1 | /** 2 | @api {POST} /zeus-server/service/queryService queryService 3 | @apiName ServiceDiscovery 4 | @apiGroup ServiceDiscovery 5 | @apiVersion 1.0.0 6 | 7 | @apiExample {curl} Example usage: 8 | curl -X POST 9 | https://api.zeus.com/zeus-server/service/queryService 10 | -H 'Accept: application/json' 11 | 12 | 13 | @apiSuccessExample {json} Success-Response: 14 | [ 15 | { 16 | "id":1,"serviceName":"domain","serviceAddr":"127.0.0.1", 17 | "port":8888,"living":1,"comment":"管理服务" 18 | },{ 19 | "id":2,"serviceName":"RpcDemo","serviceAddr":"127.0.0.1", 20 | "port":8881,"living":1,"comment":"远程服务" 21 | } 22 | ] 23 | */ 24 | -------------------------------------------------------------------------------- /zeus-discovery/doc/apidoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "zeus-api", 3 | "version": "1.0.0", 4 | "description": "Zeus API Document", 5 | "title": "Zeus API Document", 6 | "url": "https://api.zeus.com", 7 | "template": { 8 | "withCompare": true, 9 | "withGenerator": true 10 | } 11 | } -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/api_project.js: -------------------------------------------------------------------------------- 1 | define({ 2 | "name": "zeus-api", 3 | "version": "1.0.0", 4 | "description": "Zeus API Document", 5 | "title": "Zeus API Document", 6 | "url": "https://api.zeus.com", 7 | "template": { 8 | "withCompare": true, 9 | "withGenerator": true 10 | }, 11 | "sampleUrl": false, 12 | "defaultVersion": "0.0.0", 13 | "apidoc": "0.3.0", 14 | "generator": { 15 | "name": "apidoc", 16 | "time": "2020-04-08T09:51:41.018Z", 17 | "url": "http://apidocjs.com", 18 | "version": "0.19.1" 19 | } 20 | }); 21 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/api_project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "zeus-api", 3 | "version": "1.0.0", 4 | "description": "Zeus API Document", 5 | "title": "Zeus API Document", 6 | "url": "https://api.zeus.com", 7 | "template": { 8 | "withCompare": true, 9 | "withGenerator": true 10 | }, 11 | "sampleUrl": false, 12 | "defaultVersion": "0.0.0", 13 | "apidoc": "0.3.0", 14 | "generator": { 15 | "name": "apidoc", 16 | "time": "2020-04-08T09:51:41.018Z", 17 | "url": "http://apidocjs.com", 18 | "version": "0.19.1" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CasterWx/Zeus/4187c50f13aa3ea041d60677a17fb147fe42100e/zeus-discovery/doc/doc/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CasterWx/Zeus/4187c50f13aa3ea041d60677a17fb147fe42100e/zeus-discovery/doc/doc/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CasterWx/Zeus/4187c50f13aa3ea041d60677a17fb147fe42100e/zeus-discovery/doc/doc/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CasterWx/Zeus/4187c50f13aa3ea041d60677a17fb147fe42100e/zeus-discovery/doc/doc/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CasterWx/Zeus/4187c50f13aa3ea041d60677a17fb147fe42100e/zeus-discovery/doc/doc/img/favicon.ico -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/locales/ca.js: -------------------------------------------------------------------------------- 1 | define({ 2 | ca: { 3 | 'Allowed values:' : 'Valors permesos:', 4 | 'Compare all with predecessor': 'Comparar tot amb versió anterior', 5 | 'compare changes to:' : 'comparar canvis amb:', 6 | 'compared to' : 'comparat amb', 7 | 'Default value:' : 'Valor per defecte:', 8 | 'Description' : 'Descripció', 9 | 'Field' : 'Camp', 10 | 'General' : 'General', 11 | 'Generated with' : 'Generat amb', 12 | 'Name' : 'Nom', 13 | 'No response values.' : 'Sense valors en la resposta.', 14 | 'optional' : 'opcional', 15 | 'Parameter' : 'Paràmetre', 16 | 'Permission:' : 'Permisos:', 17 | 'Response' : 'Resposta', 18 | 'Send' : 'Enviar', 19 | 'Send a Sample Request' : 'Enviar una petició d\'exemple', 20 | 'show up to version:' : 'mostrar versió:', 21 | 'Size range:' : 'Tamany de rang:', 22 | 'Type' : 'Tipus', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/locales/cs.js: -------------------------------------------------------------------------------- 1 | define({ 2 | cs: { 3 | 'Allowed values:' : 'Povolené hodnoty:', 4 | 'Compare all with predecessor': 'Porovnat vše s předchozími verzemi', 5 | 'compare changes to:' : 'porovnat změny s:', 6 | 'compared to' : 'porovnat s', 7 | 'Default value:' : 'Výchozí hodnota:', 8 | 'Description' : 'Popis', 9 | 'Field' : 'Pole', 10 | 'General' : 'Obecné', 11 | 'Generated with' : 'Vygenerováno pomocí', 12 | 'Name' : 'Název', 13 | 'No response values.' : 'Nebyly vráceny žádné hodnoty.', 14 | 'optional' : 'volitelné', 15 | 'Parameter' : 'Parametr', 16 | 'Permission:' : 'Oprávnění:', 17 | 'Response' : 'Odpověď', 18 | 'Send' : 'Odeslat', 19 | 'Send a Sample Request' : 'Odeslat ukázkový požadavek', 20 | 'show up to version:' : 'zobrazit po verzi:', 21 | 'Size range:' : 'Rozsah velikosti:', 22 | 'Type' : 'Typ', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/locales/de.js: -------------------------------------------------------------------------------- 1 | define({ 2 | de: { 3 | 'Allowed values:' : 'Erlaubte Werte:', 4 | 'Compare all with predecessor': 'Vergleiche alle mit ihren Vorgängern', 5 | 'compare changes to:' : 'vergleiche Änderungen mit:', 6 | 'compared to' : 'verglichen mit', 7 | 'Default value:' : 'Standardwert:', 8 | 'Description' : 'Beschreibung', 9 | 'Field' : 'Feld', 10 | 'General' : 'Allgemein', 11 | 'Generated with' : 'Erstellt mit', 12 | 'Name' : 'Name', 13 | 'No response values.' : 'Keine Rückgabewerte.', 14 | 'optional' : 'optional', 15 | 'Parameter' : 'Parameter', 16 | 'Permission:' : 'Berechtigung:', 17 | 'Response' : 'Antwort', 18 | 'Send' : 'Senden', 19 | 'Send a Sample Request' : 'Eine Beispielanfrage senden', 20 | 'show up to version:' : 'zeige bis zur Version:', 21 | 'Size range:' : 'Größenbereich:', 22 | 'Type' : 'Typ', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/locales/es.js: -------------------------------------------------------------------------------- 1 | define({ 2 | es: { 3 | 'Allowed values:' : 'Valores permitidos:', 4 | 'Compare all with predecessor': 'Comparar todo con versión anterior', 5 | 'compare changes to:' : 'comparar cambios con:', 6 | 'compared to' : 'comparado con', 7 | 'Default value:' : 'Valor por defecto:', 8 | 'Description' : 'Descripción', 9 | 'Field' : 'Campo', 10 | 'General' : 'General', 11 | 'Generated with' : 'Generado con', 12 | 'Name' : 'Nombre', 13 | 'No response values.' : 'Sin valores en la respuesta.', 14 | 'optional' : 'opcional', 15 | 'Parameter' : 'Parámetro', 16 | 'Permission:' : 'Permisos:', 17 | 'Response' : 'Respuesta', 18 | 'Send' : 'Enviar', 19 | 'Send a Sample Request' : 'Enviar una petición de ejemplo', 20 | 'show up to version:' : 'mostrar a versión:', 21 | 'Size range:' : 'Tamaño de rango:', 22 | 'Type' : 'Tipo', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/locales/fr.js: -------------------------------------------------------------------------------- 1 | define({ 2 | fr: { 3 | 'Allowed values:' : 'Valeurs autorisées :', 4 | 'Compare all with predecessor': 'Tout comparer avec ...', 5 | 'compare changes to:' : 'comparer les changements à :', 6 | 'compared to' : 'comparer à', 7 | 'Default value:' : 'Valeur par défaut :', 8 | 'Description' : 'Description', 9 | 'Field' : 'Champ', 10 | 'General' : 'Général', 11 | 'Generated with' : 'Généré avec', 12 | 'Name' : 'Nom', 13 | 'No response values.' : 'Aucune valeur de réponse.', 14 | 'optional' : 'optionnel', 15 | 'Parameter' : 'Paramètre', 16 | 'Permission:' : 'Permission :', 17 | 'Response' : 'Réponse', 18 | 'Send' : 'Envoyer', 19 | 'Send a Sample Request' : 'Envoyer une requête représentative', 20 | 'show up to version:' : 'Montrer à partir de la version :', 21 | 'Size range:' : 'Ordre de grandeur :', 22 | 'Type' : 'Type', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/locales/it.js: -------------------------------------------------------------------------------- 1 | define({ 2 | it: { 3 | 'Allowed values:' : 'Valori permessi:', 4 | 'Compare all with predecessor': 'Confronta tutto con versioni precedenti', 5 | 'compare changes to:' : 'confronta modifiche con:', 6 | 'compared to' : 'confrontato con', 7 | 'Default value:' : 'Valore predefinito:', 8 | 'Description' : 'Descrizione', 9 | 'Field' : 'Campo', 10 | 'General' : 'Generale', 11 | 'Generated with' : 'Creato con', 12 | 'Name' : 'Nome', 13 | 'No response values.' : 'Nessun valore di risposta.', 14 | 'optional' : 'opzionale', 15 | 'Parameter' : 'Parametro', 16 | 'Permission:' : 'Permessi:', 17 | 'Response' : 'Risposta', 18 | 'Send' : 'Invia', 19 | 'Send a Sample Request' : 'Invia una richiesta di esempio', 20 | 'show up to version:' : 'mostra alla versione:', 21 | 'Size range:' : 'Intervallo dimensione:', 22 | 'Type' : 'Tipo', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/locales/locale.js: -------------------------------------------------------------------------------- 1 | define([ 2 | './locales/ca.js', 3 | './locales/cs.js', 4 | './locales/de.js', 5 | './locales/es.js', 6 | './locales/fr.js', 7 | './locales/it.js', 8 | './locales/nl.js', 9 | './locales/pl.js', 10 | './locales/pt_br.js', 11 | './locales/ro.js', 12 | './locales/ru.js', 13 | './locales/tr.js', 14 | './locales/vi.js', 15 | './locales/zh.js', 16 | './locales/zh_cn.js' 17 | ], function() { 18 | var langId = (navigator.language || navigator.userLanguage).toLowerCase().replace('-', '_'); 19 | var language = langId.substr(0, 2); 20 | var locales = {}; 21 | 22 | for (index in arguments) { 23 | for (property in arguments[index]) 24 | locales[property] = arguments[index][property]; 25 | } 26 | if ( ! locales['en']) 27 | locales['en'] = {}; 28 | 29 | if ( ! locales[langId] && ! locales[language]) 30 | language = 'en'; 31 | 32 | var locale = (locales[langId] ? locales[langId] : locales[language]); 33 | 34 | function __(text) { 35 | var index = locale[text]; 36 | if (index === undefined) 37 | return text; 38 | return index; 39 | }; 40 | 41 | function setLanguage(language) { 42 | locale = locales[language]; 43 | } 44 | 45 | return { 46 | __ : __, 47 | locales : locales, 48 | locale : locale, 49 | setLanguage: setLanguage 50 | }; 51 | }); 52 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/locales/nl.js: -------------------------------------------------------------------------------- 1 | define({ 2 | nl: { 3 | 'Allowed values:' : 'Toegestane waarden:', 4 | 'Compare all with predecessor': 'Vergelijk alle met voorgaande versie', 5 | 'compare changes to:' : 'vergelijk veranderingen met:', 6 | 'compared to' : 'vergelijk met', 7 | 'Default value:' : 'Standaard waarde:', 8 | 'Description' : 'Omschrijving', 9 | 'Field' : 'Veld', 10 | 'General' : 'Algemeen', 11 | 'Generated with' : 'Gegenereerd met', 12 | 'Name' : 'Naam', 13 | 'No response values.' : 'Geen response waardes.', 14 | 'optional' : 'optioneel', 15 | 'Parameter' : 'Parameter', 16 | 'Permission:' : 'Permissie:', 17 | 'Response' : 'Antwoorden', 18 | 'Send' : 'Sturen', 19 | 'Send a Sample Request' : 'Stuur een sample aanvragen', 20 | 'show up to version:' : 'toon tot en met versie:', 21 | 'Size range:' : 'Maatbereik:', 22 | 'Type' : 'Type', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/locales/pl.js: -------------------------------------------------------------------------------- 1 | define({ 2 | pl: { 3 | 'Allowed values:' : 'Dozwolone wartości:', 4 | 'Compare all with predecessor': 'Porównaj z poprzednimi wersjami', 5 | 'compare changes to:' : 'porównaj zmiany do:', 6 | 'compared to' : 'porównaj do:', 7 | 'Default value:' : 'Wartość domyślna:', 8 | 'Description' : 'Opis', 9 | 'Field' : 'Pole', 10 | 'General' : 'Generalnie', 11 | 'Generated with' : 'Wygenerowano z', 12 | 'Name' : 'Nazwa', 13 | 'No response values.' : 'Brak odpowiedzi.', 14 | 'optional' : 'opcjonalny', 15 | 'Parameter' : 'Parametr', 16 | 'Permission:' : 'Uprawnienia:', 17 | 'Response' : 'Odpowiedź', 18 | 'Send' : 'Wyślij', 19 | 'Send a Sample Request' : 'Wyślij przykładowe żądanie', 20 | 'show up to version:' : 'pokaż do wersji:', 21 | 'Size range:' : 'Zakres rozmiaru:', 22 | 'Type' : 'Typ', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/locales/pt_br.js: -------------------------------------------------------------------------------- 1 | define({ 2 | 'pt_br': { 3 | 'Allowed values:' : 'Valores permitidos:', 4 | 'Compare all with predecessor': 'Compare todos com antecessores', 5 | 'compare changes to:' : 'comparar alterações com:', 6 | 'compared to' : 'comparado com', 7 | 'Default value:' : 'Valor padrão:', 8 | 'Description' : 'Descrição', 9 | 'Field' : 'Campo', 10 | 'General' : 'Geral', 11 | 'Generated with' : 'Gerado com', 12 | 'Name' : 'Nome', 13 | 'No response values.' : 'Sem valores de resposta.', 14 | 'optional' : 'opcional', 15 | 'Parameter' : 'Parâmetro', 16 | 'Permission:' : 'Permissão:', 17 | 'Response' : 'Resposta', 18 | 'Send' : 'Enviar', 19 | 'Send a Sample Request' : 'Enviar um Exemplo de Pedido', 20 | 'show up to version:' : 'aparecer para a versão:', 21 | 'Size range:' : 'Faixa de tamanho:', 22 | 'Type' : 'Tipo', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/locales/ro.js: -------------------------------------------------------------------------------- 1 | define({ 2 | ro: { 3 | 'Allowed values:' : 'Valori permise:', 4 | 'Compare all with predecessor': 'Compară toate cu versiunea precedentă', 5 | 'compare changes to:' : 'compară cu versiunea:', 6 | 'compared to' : 'comparat cu', 7 | 'Default value:' : 'Valoare implicită:', 8 | 'Description' : 'Descriere', 9 | 'Field' : 'Câmp', 10 | 'General' : 'General', 11 | 'Generated with' : 'Generat cu', 12 | 'Name' : 'Nume', 13 | 'No response values.' : 'Nici o valoare returnată.', 14 | 'optional' : 'opțional', 15 | 'Parameter' : 'Parametru', 16 | 'Permission:' : 'Permisiune:', 17 | 'Response' : 'Răspuns', 18 | 'Send' : 'Trimite', 19 | 'Send a Sample Request' : 'Trimite o cerere de probă', 20 | 'show up to version:' : 'arată până la versiunea:', 21 | 'Size range:' : 'Interval permis:', 22 | 'Type' : 'Tip', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/locales/ru.js: -------------------------------------------------------------------------------- 1 | define({ 2 | ru: { 3 | 'Allowed values:' : 'Допустимые значения:', 4 | 'Compare all with predecessor': 'Сравнить с предыдущей версией', 5 | 'compare changes to:' : 'сравнить с:', 6 | 'compared to' : 'в сравнении с', 7 | 'Default value:' : 'По умолчанию:', 8 | 'Description' : 'Описание', 9 | 'Field' : 'Название', 10 | 'General' : 'Общая информация', 11 | 'Generated with' : 'Сгенерировано с помощью', 12 | 'Name' : 'Название', 13 | 'No response values.' : 'Нет значений для ответа.', 14 | 'optional' : 'необязательный', 15 | 'Parameter' : 'Параметр', 16 | 'Permission:' : 'Разрешено:', 17 | 'Response' : 'Ответ', 18 | 'Send' : 'Отправить', 19 | 'Send a Sample Request' : 'Отправить тестовый запрос', 20 | 'show up to version:' : 'показать версию:', 21 | 'Size range:' : 'Ограничения:', 22 | 'Type' : 'Тип', 23 | 'url' : 'URL' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/locales/tr.js: -------------------------------------------------------------------------------- 1 | define({ 2 | tr: { 3 | 'Allowed values:' : 'İzin verilen değerler:', 4 | 'Compare all with predecessor': 'Tümünü öncekiler ile karşılaştır', 5 | 'compare changes to:' : 'değişiklikleri karşılaştır:', 6 | 'compared to' : 'karşılaştır', 7 | 'Default value:' : 'Varsayılan değer:', 8 | 'Description' : 'Açıklama', 9 | 'Field' : 'Alan', 10 | 'General' : 'Genel', 11 | 'Generated with' : 'Oluşturan', 12 | 'Name' : 'İsim', 13 | 'No response values.' : 'Dönüş verisi yok.', 14 | 'optional' : 'opsiyonel', 15 | 'Parameter' : 'Parametre', 16 | 'Permission:' : 'İzin:', 17 | 'Response' : 'Dönüş', 18 | 'Send' : 'Gönder', 19 | 'Send a Sample Request' : 'Örnek istek gönder', 20 | 'show up to version:' : 'bu versiyona kadar göster:', 21 | 'Size range:' : 'Boyut aralığı:', 22 | 'Type' : 'Tip', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/locales/vi.js: -------------------------------------------------------------------------------- 1 | define({ 2 | vi: { 3 | 'Allowed values:' : 'Giá trị chấp nhận:', 4 | 'Compare all with predecessor': 'So sánh với tất cả phiên bản trước', 5 | 'compare changes to:' : 'so sánh sự thay đổi với:', 6 | 'compared to' : 'so sánh với', 7 | 'Default value:' : 'Giá trị mặc định:', 8 | 'Description' : 'Chú thích', 9 | 'Field' : 'Trường dữ liệu', 10 | 'General' : 'Tổng quan', 11 | 'Generated with' : 'Được tạo bởi', 12 | 'Name' : 'Tên', 13 | 'No response values.' : 'Không có kết quả trả về.', 14 | 'optional' : 'Tùy chọn', 15 | 'Parameter' : 'Tham số', 16 | 'Permission:' : 'Quyền hạn:', 17 | 'Response' : 'Kết quả', 18 | 'Send' : 'Gửi', 19 | 'Send a Sample Request' : 'Gửi một yêu cầu mẫu', 20 | 'show up to version:' : 'hiển thị phiên bản:', 21 | 'Size range:' : 'Kích cỡ:', 22 | 'Type' : 'Kiểu', 23 | 'url' : 'liên kết' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/locales/zh.js: -------------------------------------------------------------------------------- 1 | define({ 2 | zh: { 3 | 'Allowed values​​:' : '允許值:', 4 | 'Compare all with predecessor': '預先比較所有', 5 | 'compare changes to:' : '比較變更:', 6 | 'compared to' : '對比', 7 | 'Default value:' : '預設值:', 8 | 'Description' : '描述', 9 | 'Field' : '欄位', 10 | 'General' : '概括', 11 | 'Generated with' : '生成工具', 12 | 'Name' : '名稱', 13 | 'No response values​​.' : '無對應資料.', 14 | 'optional' : '選填', 15 | 'Parameter' : '參數', 16 | 'Permission:' : '權限:', 17 | 'Response' : '回應', 18 | 'Send' : '發送', 19 | 'Send a Sample Request' : '發送試用需求', 20 | 'show up to version:' : '顯示到版本:', 21 | 'Size range:' : '區間:', 22 | 'Type' : '類型', 23 | 'url' : '網址' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/locales/zh_cn.js: -------------------------------------------------------------------------------- 1 | define({ 2 | 'zh_cn': { 3 | 'Allowed values:' : '允许值:', 4 | 'Compare all with predecessor': '与所有较早的比较', 5 | 'compare changes to:' : '将当前版本与指定版本比较:', 6 | 'compared to' : '相比于', 7 | 'Default value:' : '默认值:', 8 | 'Description' : '描述', 9 | 'Field' : '字段', 10 | 'General' : '概要', 11 | 'Generated with' : '基于', 12 | 'Name' : '名称', 13 | 'No response values.' : '无返回值.', 14 | 'optional' : '可选', 15 | 'Parameter' : '参数', 16 | 'Parameters' : '参数', 17 | 'Headers' : '头部参数', 18 | 'Permission:' : '权限:', 19 | 'Response' : '返回', 20 | 'Send' : '发送', 21 | 'Send a Sample Request' : '发送示例请求', 22 | 'show up to version:' : '显示到指定版本:', 23 | 'Size range:' : '取值范围:', 24 | 'Type' : '类型', 25 | 'url' : '网址' 26 | } 27 | }); 28 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/path-to-regexp/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-Splus.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2012 Jeffrey B. Arnold 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\'(?:[^\'\\]|\\[\s\S])*(?:\'|$)/,null,"'"]],[["com",/^#.*/],["kwd",/^(?:if|else|for|while|repeat|in|next|break|return|switch|function)(?![A-Za-z0-9_.])/],["lit",/^0[xX][a-fA-F0-9]+([pP][0-9]+)?[Li]?/],["lit",/^[+-]?([0-9]+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?[Li]?/],["lit",/^(?:NULL|NA(?:_(?:integer|real|complex|character)_)?|Inf|TRUE|FALSE|NaN|\.\.(?:\.|[0-9]+))(?![A-Za-z0-9_.])/], 18 | ["pun",/^(?:<>?|-|==|<=|>=|<|>|&&?|!=|\|\|?|\*|\+|\^|\/|!|%.*?%|=|~|\$|@|:{1,3}|[\[\](){};,?])/],["pln",/^(?:[A-Za-z]+[A-Za-z0-9_.]*|\.[a-zA-Z_][0-9a-zA-Z\._]*)(?![A-Za-z0-9_.])/],["str",/^`.+`/]]),["r","s","R","S","Splus"]); 19 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-aea.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2009 Onno Hommes. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\r\n]*/,null,"#"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/, 18 | null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[SE]?BANK\=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[!-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),["apollo","agc","aea"]); 19 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-agc.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2009 Onno Hommes. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\r\n]*/,null,"#"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/, 18 | null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[SE]?BANK\=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[!-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),["apollo","agc","aea"]); 19 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-apollo.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2009 Onno Hommes. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\r\n]*/,null,"#"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/, 18 | null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[SE]?BANK\=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[!-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),["apollo","agc","aea"]); 19 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-basic.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2013 Peter Kofler 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:"(?:[^\\"\r\n]|\\.)*(?:"|$))/,null,'"'],["pln",/^\s+/,null," \r\n\t\u00a0"]],[["com",/^REM[^\r\n]*/,null],["kwd",/^\b(?:AND|CLOSE|CLR|CMD|CONT|DATA|DEF ?FN|DIM|END|FOR|GET|GOSUB|GOTO|IF|INPUT|LET|LIST|LOAD|NEW|NEXT|NOT|ON|OPEN|OR|POKE|PRINT|READ|RESTORE|RETURN|RUN|SAVE|STEP|STOP|SYS|THEN|TO|VERIFY|WAIT)\b/,null],["pln",/^[A-Z][A-Z0-9]?(?:\$|%)?/i,null],["lit",/^(?:\d+(?:\.\d*)?|\.\d+)(?:e[+\-]?\d+)?/i, 18 | null,"0123456789"],["pun",/^.[^\s\w\.$%"]*/,null]]),["basic","cbm"]); 19 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-cbm.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2013 Peter Kofler 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:"(?:[^\\"\r\n]|\\.)*(?:"|$))/,null,'"'],["pln",/^\s+/,null," \r\n\t\u00a0"]],[["com",/^REM[^\r\n]*/,null],["kwd",/^\b(?:AND|CLOSE|CLR|CMD|CONT|DATA|DEF ?FN|DIM|END|FOR|GET|GOSUB|GOTO|IF|INPUT|LET|LIST|LOAD|NEW|NEXT|NOT|ON|OPEN|OR|POKE|PRINT|READ|RESTORE|RETURN|RUN|SAVE|STEP|STOP|SYS|THEN|TO|VERIFY|WAIT)\b/,null],["pln",/^[A-Z][A-Z0-9]?(?:\$|%)?/i,null],["lit",/^(?:\d+(?:\.\d*)?|\.\d+)(?:e[+\-]?\d+)?/i, 18 | null,"0123456789"],["pun",/^.[^\s\w\.$%"]*/,null]]),["basic","cbm"]); 19 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-cl.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, 18 | null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" ")); 19 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-clj.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Google Inc. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^[\(\{\[]+/,null,"([{"],["clo",/^[\)\}\]]+/,null,")]}"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:def|if|do|let|quote|var|fn|loop|recur|throw|try|monitor-enter|monitor-exit|defmacro|defn|defn-|macroexpand|macroexpand-1|for|doseq|dosync|dotimes|and|or|when|not|assert|doto|proxy|defstruct|first|rest|cons|defprotocol|deftype|defrecord|reify|defmulti|defmethod|meta|with-meta|ns|in-ns|create-ns|import|intern|refer|alias|namespace|resolve|ref|deref|refset|new|set!|memfn|to-array|into-array|aset|gen-class|reduce|map|filter|find|nil?|empty?|hash-map|hash-set|vec|vector|seq|flatten|reverse|assoc|dissoc|list|list?|disj|get|union|difference|intersection|extend|extend-type|extend-protocol|prn)\b/, 17 | null],["typ",/^:[0-9a-zA-Z\-]+/]]),["clj"]); 18 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-css.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2009 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[["str",/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],["str",/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']+)\)/i],["kwd",/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//], 18 | ["com",/^(?:\x3c!--|--\x3e)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#(?:[0-9a-f]{3}){1,2}\b/i],["pln",/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],["pun",/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^\)\"\']+/]]),["css-str"]); 19 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-dart.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2013 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"]],[["com",/^#!(?:.*)/],["kwd",/^\b(?:import|library|part of|part|as|show|hide)\b/i],["com",/^\/\/(?:.*)/],["com",/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],["kwd",/^\b(?:class|interface)\b/i],["kwd",/^\b(?:assert|async|await|break|case|catch|continue|default|do|else|finally|for|if|in|is|new|return|super|switch|sync|this|throw|try|while)\b/i],["kwd",/^\b(?:abstract|const|extends|factory|final|get|implements|native|operator|set|static|typedef|var)\b/i], 18 | ["typ",/^\b(?:bool|double|Dynamic|int|num|Object|String|void)\b/i],["kwd",/^\b(?:false|null|true)\b/i],["str",/^r?[\']{3}[\s|\S]*?[^\\][\']{3}/],["str",/^r?[\"]{3}[\s|\S]*?[^\\][\"]{3}/],["str",/^r?\'(\'|(?:[^\n\r\f])*?[^\\]\')/],["str",/^r?\"(\"|(?:[^\n\r\f])*?[^\\]\")/],["typ",/^[A-Z]\w*/],["pln",/^[a-z_$][a-z0-9_]*/i],["pun",/^[~!%^&*+=|?:<>/-]/],["lit",/^\b0x[0-9a-f]+/i],["lit",/^\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i],["lit", 19 | /^\b\.\d+(?:e[+-]?\d+)?/i],["pun",/^[(){}\[\],.;]/]]),["dart"]); 20 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-el.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, 18 | null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" ")); 19 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-erl.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2013 Andrew Allen 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\x0B\x0C\r ]+/,null,"\t\n\x0B\f\r "],["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["lit",/^[a-z][a-zA-Z0-9_]*/],["lit",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])+\'?/,null,"'"],["lit",/^\?[^ \t\n({]+/,null,"?"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\n]*/],["kwd",/^(?:module|attributes|do|let|in|letrec|apply|call|primop|case|of|end|when|fun|try|catch|receive|after|char|integer|float,atom,string,var)\b/], 18 | ["kwd",/^-[a-z_]+/],["typ",/^[A-Z_][a-zA-Z0-9_]*/],["pun",/^[.,;]/]]),["erlang","erl"]); 19 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-erlang.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2013 Andrew Allen 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\x0B\x0C\r ]+/,null,"\t\n\x0B\f\r "],["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["lit",/^[a-z][a-zA-Z0-9_]*/],["lit",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])+\'?/,null,"'"],["lit",/^\?[^ \t\n({]+/,null,"?"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\n]*/],["kwd",/^(?:module|attributes|do|let|in|letrec|apply|call|primop|case|of|end|when|fun|try|catch|receive|after|char|integer|float,atom,string,var)\b/], 18 | ["kwd",/^-[a-z_]+/],["typ",/^[A-Z_][a-zA-Z0-9_]*/],["pun",/^[.,;]/]]),["erlang","erl"]); 19 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-fs.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["com",/^#(?:if[\t\n\r \xA0]+(?:[a-z_$][\w\']*|``[^\r\n\t`]*(?:``|$))|else|endif|light)/i,null,"#"],["str",/^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])(?:\'|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\r\n]*|\(\*[\s\S]*?\*\))/],["kwd",/^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/], 18 | ["lit",/^[+\-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],["pln",/^(?:[a-z_][\w']*[!?#]?|``[^\r\n\t`]*(?:``|$))/i],["pun",/^[^\t\n\r \xA0\"\'\w]+/]]),["fs","ml"]); 19 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-go.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2010 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["pln",/^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])+(?:\'|$)|`[^`]*(?:`|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\r\n]*|\/\*[\s\S]*?\*\/)/],["pln",/^(?:[^\/\"\'`]|\/(?![\/\*]))+/i]]),["go"]); 18 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-hs.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2009 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\x0B\x0C\r ]+/,null,"\t\n\x0B\f\r "],["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])\'?/,null,"'"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^(?:(?:--+(?:[^\r\n\x0C]*)?)|(?:\{-(?:[^-]|-+[^-\}])*-\}))/],["kwd",/^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^a-zA-Z0-9\']|$)/, 18 | null],["pln",/^(?:[A-Z][\w\']*\.)*[a-zA-Z][\w\']*/],["pun",/^[^\t\n\x0B\x0C\r a-zA-Z0-9\'\"]+/]]),["hs"]); 19 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-latex.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2011 Martin S. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\r\n]*/,null,"%"]],[["kwd",/^\\[a-zA-Z@]+/],["kwd",/^\\./],["typ",/^[$&]/],["lit",/[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i],["pun",/^[{}()\[\]=]+/]]),["latex","tex"]); 18 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-lgt.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2014 Paulo Moura 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["lit",/^[a-z][a-zA-Z0-9_]*/],["lit",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])+\'?/,null,"'"],["lit",/^(?:0'.|0b[0-1]+|0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\r\n]*/,null,"%"],["com",/^\/\*[\s\S]*?\*\//],["kwd",/^\s*:-\s(c(a(lls|tegory)|oinductive)|p(ublic|r(ot(ocol|ected)|ivate))|e(l(if|se)|n(coding|sure_loaded)|xport)|i(f|n(clude|itialization|fo))|alias|d(ynamic|iscontiguous)|m(eta_(non_terminal|predicate)|od(e|ule)|ultifile)|reexport|s(et_(logtalk|prolog)_flag|ynchronized)|o(bject|p)|use(s|_module))/], 18 | ["kwd",/^\s*:-\s(e(lse|nd(if|_(category|object|protocol)))|built_in|dynamic|synchronized|threaded)/],["typ",/^[A-Z_][a-zA-Z0-9_]*/],["pun",/^[.,;{}:^<>=\\/+*?#!-]/]]),["logtalk","lgt"]); 19 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-lisp.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, 18 | null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" ")); 19 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-ll.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2013 Nikhil Dabas 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^!?\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["com",/^;[^\r\n]*/,null,";"]],[["pln",/^[%@!](?:[-a-zA-Z$._][-a-zA-Z$._0-9]*|\d+)/],["kwd",/^[A-Za-z_][0-9A-Za-z_]*/,null],["lit",/^\d+\.\d+/],["lit",/^(?:\d+|0[xX][a-fA-F0-9]+)/],["pun",/^[()\[\]{},=*<>:]|\.\.\.$/]]),["llvm","ll"]); 18 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-llvm.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2013 Nikhil Dabas 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^!?\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["com",/^;[^\r\n]*/,null,";"]],[["pln",/^[%@!](?:[-a-zA-Z$._][-a-zA-Z$._0-9]*|\d+)/],["kwd",/^[A-Za-z_][0-9A-Za-z_]*/,null],["lit",/^\d+\.\d+/],["lit",/^(?:\d+|0[xX][a-fA-F0-9]+)/],["pun",/^[()\[\]{},=*<>:]|\.\.\.$/]]),["llvm","ll"]); 18 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-logtalk.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2014 Paulo Moura 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["lit",/^[a-z][a-zA-Z0-9_]*/],["lit",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])+\'?/,null,"'"],["lit",/^(?:0'.|0b[0-1]+|0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\r\n]*/,null,"%"],["com",/^\/\*[\s\S]*?\*\//],["kwd",/^\s*:-\s(c(a(lls|tegory)|oinductive)|p(ublic|r(ot(ocol|ected)|ivate))|e(l(if|se)|n(coding|sure_loaded)|xport)|i(f|n(clude|itialization|fo))|alias|d(ynamic|iscontiguous)|m(eta_(non_terminal|predicate)|od(e|ule)|ultifile)|reexport|s(et_(logtalk|prolog)_flag|ynchronized)|o(bject|p)|use(s|_module))/], 18 | ["kwd",/^\s*:-\s(e(lse|nd(if|_(category|object|protocol)))|built_in|dynamic|synchronized|threaded)/],["typ",/^[A-Z_][a-zA-Z0-9_]*/],["pun",/^[.,;{}:^<>=\\/+*?#!-]/]]),["logtalk","lgt"]); 19 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-lsp.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, 18 | null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" ")); 19 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-lua.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])*(?:\'|$))/,null,"\"'"]],[["com",/^--(?:\[(=*)\[[\s\S]*?(?:\]\1\]|$)|[^\r\n]*)/],["str",/^\[(=*)\[[\s\S]*?(?:\]\1\]|$)/],["kwd",/^(?:and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,null],["lit",/^[+-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i], 18 | ["pln",/^[a-z_]\w*/i],["pun",/^[^\w\t\n\r \xA0][^\w\t\n\r \xA0\"\'\-\+=]*/]]),["lua"]); 19 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-mumps.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2011 Kitware Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^"]|\\.)*")/,null,'"']],[["com",/^;[^\r\n]*/,null,";"],["dec",/^(?:\$(?:D|DEVICE|EC|ECODE|ES|ESTACK|ET|ETRAP|H|HOROLOG|I|IO|J|JOB|K|KEY|P|PRINCIPAL|Q|QUIT|ST|STACK|S|STORAGE|SY|SYSTEM|T|TEST|TL|TLEVEL|TR|TRESTART|X|Y|Z[A-Z]*|A|ASCII|C|CHAR|D|DATA|E|EXTRACT|F|FIND|FN|FNUMBER|G|GET|J|JUSTIFY|L|LENGTH|NA|NAME|O|ORDER|P|PIECE|QL|QLENGTH|QS|QSUBSCRIPT|Q|QUERY|R|RANDOM|RE|REVERSE|S|SELECT|ST|STACK|T|TEXT|TR|TRANSLATE|NaN))\b/i, 18 | null],["kwd",/^(?:[^\$]B|BREAK|C|CLOSE|D|DO|E|ELSE|F|FOR|G|GOTO|H|HALT|H|HANG|I|IF|J|JOB|K|KILL|L|LOCK|M|MERGE|N|NEW|O|OPEN|Q|QUIT|R|READ|S|SET|TC|TCOMMIT|TRE|TRESTART|TRO|TROLLBACK|TS|TSTART|U|USE|V|VIEW|W|WRITE|X|XECUTE)\b/i,null],["lit",/^[+-]?(?:(?:\.\d+|\d+(?:\.\d*)?)(?:E[+\-]?\d+)?)/i],["pln",/^[a-z][a-zA-Z0-9]*/i],["pun",/^[^\w\t\n\r\xA0\"\$;%\^]|_/]]),["mumps"]); 19 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-pascal.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2013 Peter Kofler 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$))/,null,"'"],["pln",/^\s+/,null," \r\n\t\u00a0"]],[["com",/^\(\*[\s\S]*?(?:\*\)|$)|^\{[\s\S]*?(?:\}|$)/,null],["kwd",/^(?:ABSOLUTE|AND|ARRAY|ASM|ASSEMBLER|BEGIN|CASE|CONST|CONSTRUCTOR|DESTRUCTOR|DIV|DO|DOWNTO|ELSE|END|EXTERNAL|FOR|FORWARD|FUNCTION|GOTO|IF|IMPLEMENTATION|IN|INLINE|INTERFACE|INTERRUPT|LABEL|MOD|NOT|OBJECT|OF|OR|PACKED|PROCEDURE|PROGRAM|RECORD|REPEAT|SET|SHL|SHR|THEN|TO|TYPE|UNIT|UNTIL|USES|VAR|VIRTUAL|WHILE|WITH|XOR)\b/i, 18 | null],["lit",/^(?:true|false|self|nil)/i,null],["pln",/^[a-z][a-z0-9]*/i,null],["lit",/^(?:\$[a-f0-9]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+\-]?\d+)?)/i,null,"0123456789"],["pun",/^.[^\s\w\.$@\'\/]*/,null]]),["pascal"]); 19 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-proto.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2006 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.sourceDecorator({keywords:"bytes,default,double,enum,extend,extensions,false,group,import,max,message,option,optional,package,repeated,required,returns,rpc,service,syntax,to,true",types:/^(bool|(double|s?fixed|[su]?int)(32|64)|float|string)\b/,cStyleComments:!0}),["proto"]); 18 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-r.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2012 Jeffrey B. Arnold 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\'(?:[^\'\\]|\\[\s\S])*(?:\'|$)/,null,"'"]],[["com",/^#.*/],["kwd",/^(?:if|else|for|while|repeat|in|next|break|return|switch|function)(?![A-Za-z0-9_.])/],["lit",/^0[xX][a-fA-F0-9]+([pP][0-9]+)?[Li]?/],["lit",/^[+-]?([0-9]+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?[Li]?/],["lit",/^(?:NULL|NA(?:_(?:integer|real|complex|character)_)?|Inf|TRUE|FALSE|NaN|\.\.(?:\.|[0-9]+))(?![A-Za-z0-9_.])/], 18 | ["pun",/^(?:<>?|-|==|<=|>=|<|>|&&?|!=|\|\|?|\*|\+|\^|\/|!|%.*?%|=|~|\$|@|:{1,3}|[\[\](){};,?])/],["pln",/^(?:[A-Za-z]+[A-Za-z0-9_.]*|\.[a-zA-Z_][0-9a-zA-Z\._]*)(?![A-Za-z0-9_.])/],["str",/^`.+`/]]),["r","s","R","S","Splus"]); 19 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-rd.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2012 Jeffrey Arnold 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\r\n]*/,null,"%"]],[["lit",/^\\(?:cr|l?dots|R|tab)\b/],["kwd",/^\\[a-zA-Z@]+/],["kwd",/^#(?:ifn?def|endif)/],["pln",/^\\[{}]/],["pun",/^[{}()\[\]]+/]]),["Rd","rd"]); 18 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-rkt.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, 18 | null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" ")); 19 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-s.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2012 Jeffrey B. Arnold 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\'(?:[^\'\\]|\\[\s\S])*(?:\'|$)/,null,"'"]],[["com",/^#.*/],["kwd",/^(?:if|else|for|while|repeat|in|next|break|return|switch|function)(?![A-Za-z0-9_.])/],["lit",/^0[xX][a-fA-F0-9]+([pP][0-9]+)?[Li]?/],["lit",/^[+-]?([0-9]+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?[Li]?/],["lit",/^(?:NULL|NA(?:_(?:integer|real|complex|character)_)?|Inf|TRUE|FALSE|NaN|\.\.(?:\.|[0-9]+))(?![A-Za-z0-9_.])/], 18 | ["pun",/^(?:<>?|-|==|<=|>=|<|>|&&?|!=|\|\|?|\*|\+|\^|\/|!|%.*?%|=|~|\$|@|:{1,3}|[\[\](){};,?])/],["pln",/^(?:[A-Za-z]+[A-Za-z0-9_.]*|\.[a-zA-Z_][0-9a-zA-Z\._]*)(?![A-Za-z0-9_.])/],["str",/^`.+`/]]),["r","s","R","S","Splus"]); 19 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-scala.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2010 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:(?:""(?:""?(?!")|[^\\"]|\\.)*"{0,3})|(?:[^"\r\n\\]|\\.)*"?))/,null,'"'],["lit",/^`(?:[^\r\n\\`]|\\.)*`?/,null,"`"],["pun",/^[!#%&()*+,\-:;<=>?@\[\\\]^{|}~]+/,null,"!#%&()*+,-:;<=>?@[\\]^{|}~"]],[["str",/^'(?:[^\r\n\\']|\\(?:'|[^\r\n']+))'/],["lit",/^'[a-zA-Z_$][\w$]*(?!['$\w])/],["kwd",/^(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|object|override|package|private|protected|requires|return|sealed|super|throw|trait|try|type|val|var|while|with|yield)\b/], 18 | ["lit",/^(?:true|false|null|this)\b/],["lit",/^(?:(?:0(?:[0-7]+|X[0-9A-F]+))L?|(?:(?:0|[1-9][0-9]*)(?:(?:\.[0-9]+)?(?:E[+\-]?[0-9]+)?F?|L?))|\\.[0-9]+(?:E[+\-]?[0-9]+)?F?)/i],["typ",/^[$_]*[A-Z][_$A-Z0-9]*[a-z][\w$]*/],["pln",/^[$a-zA-Z_][\w$]*/],["com",/^\/(?:\/.*|\*(?:\/|\**[^*/])*(?:\*+\/?)?)/],["pun",/^(?:\.+|\/)/]]),["scala"]); 19 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-scm.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, 18 | null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" ")); 19 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-ss.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, 18 | null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" ")); 19 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-tcl.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2012 Pyrios 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\{+/,null,"{"],["clo",/^\}+/,null,"}"],["com",/^#[^\r\n]*/,null,"#"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:after|append|apply|array|break|case|catch|continue|error|eval|exec|exit|expr|for|foreach|if|incr|info|proc|return|set|switch|trace|uplevel|upvar|while)\b/,null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i], 18 | ["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),["tcl"]); 19 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-tex.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2011 Martin S. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\r\n]*/,null,"%"]],[["kwd",/^\\[a-zA-Z@]+/],["kwd",/^\\./],["typ",/^[$&]/],["lit",/[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i],["pun",/^[{}()\[\]=]+/]]),["latex","tex"]); 18 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-wiki.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2009 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t \xA0a-gi-z0-9]+/,null,"\t \u00a0abcdefgijklmnopqrstuvwxyz0123456789"],["pun",/^[=*~\^\[\]]+/,null,"=*~^[]"]],[["lang-wiki.meta",/(?:^^|\r\n?|\n)(#[a-z]+)\b/],["lit",/^(?:[A-Z][a-z][a-z0-9]+[A-Z][a-z][a-zA-Z0-9]+)\b/],["lang-",/^\{\{\{([\s\S]+?)\}\}\}/],["lang-",/^`([^\r\n`]+)`/],["str",/^https?:\/\/[^\/?#\s]*(?:\/[^?#\s]*)?(?:\?[^#\s]*)?(?:#\S*)?/i],["pln",/^(?:\r\n|[\s\S])[^#=*~^A-Zh\{`\[\r\n]*/]]),["wiki"]); 18 | PR.registerLangHandler(PR.createSimpleLexer([["kwd",/^#[a-z]+/i,null,"#"]],[]),["wiki.meta"]); 19 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-yaml.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015 ribrdb @ code.google.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:|>?]+/,null,":|>?"],["dec",/^%(?:YAML|TAG)[^#\r\n]+/,null,"%"],["typ",/^[&]\S+/,null,"&"],["typ",/^!\S*/,null,"!"],["str",/^"(?:[^\\"]|\\.)*(?:"|$)/,null,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,null,"'"],["com",/^#[^\r\n]*/,null,"#"],["pln",/^\s+/,null," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\r\n]|$)/],["pun",/^-/],["kwd",/^[\w-]+:[ \r\n]/],["pln", 18 | /^\w+/]]),["yaml","yml"]); 19 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/lang-yml.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015 ribrdb @ code.google.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:|>?]+/,null,":|>?"],["dec",/^%(?:YAML|TAG)[^#\r\n]+/,null,"%"],["typ",/^[&]\S+/,null,"&"],["typ",/^!\S*/,null,"!"],["str",/^"(?:[^\\"]|\\.)*(?:"|$)/,null,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,null,"'"],["com",/^#[^\r\n]*/,null,"#"],["pln",/^\s+/,null," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\r\n]|$)/],["pun",/^-/],["kwd",/^[\w-]+:[ \r\n]/],["pln", 18 | /^\w+/]]),["yaml","yml"]); 19 | -------------------------------------------------------------------------------- /zeus-discovery/doc/doc/vendor/prettify/prettify.css: -------------------------------------------------------------------------------- 1 | .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} -------------------------------------------------------------------------------- /zeus-discovery/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | 8 | com.antzuhl.zeus 9 | zeus-code 10 | pom 11 | 1.0-SNAPSHOT 12 | 13 | zeus-common 14 | zeus-core 15 | zeus-server 16 | zeus-example 17 | zeus-rpc-example 18 | 19 | 20 | -------------------------------------------------------------------------------- /zeus-discovery/script/audit_log.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `audit_log` 2 | ( 3 | id VARCHAR (255) PRIMARY KEY COMMENT "日志id, 服务名称-0000000000", 4 | create_time timestamp(0) NOT NULL COMMENT "日期", 5 | modify_time timestamp(0) NOT NULL COMMENT "日期", 6 | method varchar (255) COMMENT "请求方法", 7 | path varchar(255) COMMENT "请求路径", 8 | living INTEGER (255) COMMENT "是否还没有被收集,1:未收集,0:已收集", 9 | status INTEGER (255) COMMENT "状态" 10 | ) -------------------------------------------------------------------------------- /zeus-discovery/script/rpc_message.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CasterWx/Zeus/4187c50f13aa3ea041d60677a17fb147fe42100e/zeus-discovery/script/rpc_message.sql -------------------------------------------------------------------------------- /zeus-discovery/script/rpc_service.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `rpc_service` 2 | ( 3 | id 4 | create_time timestamp(0) NOT NULL COMMENT "日期", 5 | modify_time timestamp(0) NOT NULL COMMENT "日期", 6 | method varchar (255) COMMENT "请求方法", 7 | path varchar(255) COMMENT "请求路径", 8 | living INTEGER (255) COMMENT "是否还没有被收集,1:未收集,0:已收集", 9 | status INTEGER (255) COMMENT "状态" 10 | ) -------------------------------------------------------------------------------- /zeus-discovery/zeus-auth/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | zeus-code 7 | com.antzuhl.zeus 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | zeus-auth 13 | 14 | 15 | 16 | org.springframework.boot 17 | spring-boot-starter-security 18 | 2.2.6.RELEASE 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-web 23 | 2.2.6.RELEASE 24 | 25 | 26 | 27 | org.springframework.security.oauth 28 | spring-security-oauth2 29 | 2.3.6.RELEASE 30 | 31 | 32 | 33 | 34 | 35 | 36 | org.springframework.boot 37 | spring-boot-maven-plugin 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-auth/zeus-auth.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-code.iml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-common/src/main/java/com/antzuhl/zeus/dao/ServiceInfoMapper.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.dao; 2 | 3 | import com.antzuhl.zeus.entity.ServiceInfo; 4 | 5 | public interface ServiceInfoMapper { 6 | int deleteByPrimaryKey(Integer serviceId); 7 | 8 | int insert(ServiceInfo record); 9 | 10 | int insertSelective(ServiceInfo record); 11 | 12 | ServiceInfo selectByPrimaryKey(Integer serviceId); 13 | 14 | int updateByPrimaryKeySelective(ServiceInfo record); 15 | 16 | int updateByPrimaryKey(ServiceInfo record); 17 | } -------------------------------------------------------------------------------- /zeus-discovery/zeus-common/src/main/java/com/antzuhl/zeus/entity/AuditLog.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.entity; 2 | 3 | import lombok.Data; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | import java.util.Date; 8 | 9 | 10 | @Data 11 | @Getter 12 | @Setter 13 | public class AuditLog { 14 | 15 | private Long id; 16 | private String logId; 17 | private Date createTime; 18 | private Date modifyTime; 19 | private String method; 20 | private String path; 21 | private Integer living; 22 | private String useTime; 23 | private Integer status; 24 | } 25 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-common/src/main/java/com/antzuhl/zeus/entity/RpcMessage.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.entity; 2 | 3 | public class RpcMessage { 4 | } 5 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-common/src/main/java/com/antzuhl/zeus/entity/RpcService.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.entity; 2 | 3 | import java.io.Serializable; 4 | 5 | public class RpcService implements Serializable { 6 | } 7 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-common/src/main/java/com/antzuhl/zeus/entity/Service.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.entity; 2 | 3 | import lombok.Data; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | @Data 8 | @Getter 9 | @Setter 10 | public class Service { 11 | 12 | private Long id; 13 | private String serviceName; 14 | private String serviceAddr; 15 | private Integer port; 16 | private Integer living; 17 | private String comment; 18 | } 19 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-common/src/main/java/com/antzuhl/zeus/entity/request/ServiceRequest.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.entity.request; 2 | 3 | import com.antzuhl.zeus.entity.ServiceInfo; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class ServiceRequest { 8 | private Long serviceId; 9 | private String serviceName; 10 | private String serviceAddr; 11 | private Integer port; 12 | private String comment; 13 | 14 | public ServiceInfo toData() { 15 | ServiceInfo service = new ServiceInfo(); 16 | service.setServiceId(null); 17 | service.setServiceAddr(getServiceAddr()); 18 | service.setPort(getPort()); 19 | service.setComment(getComment()); 20 | return service; 21 | } 22 | 23 | 24 | public boolean isVaild() { 25 | return serviceAddr != null; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-common/src/main/java/com/antzuhl/zeus/entity/response/RpcResponse.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.entity.response; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | @Getter 7 | @Setter 8 | public class RpcResponse { 9 | private String requestId; 10 | private int code; 11 | private String error_msg; 12 | private Object data; 13 | 14 | public RpcResponse() { 15 | } 16 | 17 | public RpcResponse(String requestId, int code, String error_msg, Object data) { 18 | this.requestId = requestId; 19 | this.code = code; 20 | this.error_msg = error_msg; 21 | this.data = data; 22 | } 23 | 24 | public String getRequestId() { 25 | return requestId; 26 | } 27 | 28 | public void setRequestId(String requestId) { 29 | this.requestId = requestId; 30 | } 31 | 32 | public int getCode() { 33 | return code; 34 | } 35 | 36 | public void setCode(int code) { 37 | this.code = code; 38 | } 39 | 40 | public String getError_msg() { 41 | return error_msg; 42 | } 43 | 44 | public void setError_msg(String error_msg) { 45 | this.error_msg = error_msg; 46 | } 47 | 48 | public Object getData() { 49 | return data; 50 | } 51 | 52 | public void setData(Object data) { 53 | this.data = data; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-common/src/main/java/com/antzuhl/zeus/entity/response/ServiceInfoResponce.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.entity.response; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class ServiceInfoResponce { 7 | 8 | private Long id; 9 | private String serviceName; 10 | private String serviceAddr; 11 | private Integer living; 12 | private String comment; 13 | } 14 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-common/src/main/java/com/antzuhl/zeus/result/GenericJsonResult.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.result; 2 | 3 | public class GenericJsonResult { 4 | 5 | private int code; 6 | private String message; 7 | private T data; 8 | 9 | public int getCode() { 10 | return code; 11 | } 12 | 13 | public void setCode(int code) { 14 | this.code = code; 15 | } 16 | 17 | public void setCode(HResult code) { 18 | this.code = code.getCode(); 19 | } 20 | 21 | public String getMessage() { 22 | return message; 23 | } 24 | 25 | public void setMessage(String message) { 26 | this.message = message; 27 | } 28 | 29 | public T getData() { 30 | return data; 31 | } 32 | 33 | public void setData(T data) { 34 | this.data = data; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-common/src/main/java/com/antzuhl/zeus/result/HResult.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.result; 2 | 3 | public enum HResult implements IHResult { 4 | 5 | R_OK(0, "请求成功"), 6 | // 1XXX 7 | 8 | // 2XXX 9 | R_ALIVE(200, "服务存活") 10 | 11 | // 3XXX 12 | ; 13 | 14 | private String message; 15 | private int code; 16 | 17 | HResult(int code, String message) { 18 | this.message = message; 19 | this.setCode(code); 20 | } 21 | 22 | public String getMessage() { 23 | return message; 24 | } 25 | 26 | @Override 27 | public String getMessage(int code) { 28 | return valueOf(code).getMessage(); 29 | } 30 | 31 | 32 | public static HResult valueOf(int id) { 33 | for (HResult hr : values()) { 34 | if (hr.code == id) { 35 | return hr; 36 | } 37 | } 38 | throw new IllegalArgumentException("No matching HResult for [" + id + "]"); 39 | } 40 | 41 | public static String valueOfString(int id) { 42 | for (HResult hr : values()) { 43 | if (hr.code == id) { 44 | return hr.getMessage(); 45 | } 46 | } 47 | throw new IllegalArgumentException("No matching HResult for [" + id + "]"); 48 | } 49 | 50 | public int getCode() { 51 | return code; 52 | } 53 | 54 | public void setCode(int code) { 55 | this.code = code; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-common/src/main/java/com/antzuhl/zeus/result/IHResult.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.result; 2 | 3 | 4 | public interface IHResult { 5 | 6 | int S_OK_CODE = 0; 7 | 8 | String getMessage(); 9 | 10 | String getMessage(int code); 11 | 12 | int getCode(); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-common/src/main/java/com/antzuhl/zeus/utils/JSONDecoder.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.utils; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import io.netty.buffer.ByteBuf; 5 | import io.netty.channel.ChannelHandlerContext; 6 | import io.netty.handler.codec.LengthFieldBasedFrameDecoder; 7 | 8 | public class JSONDecoder extends LengthFieldBasedFrameDecoder { 9 | 10 | public JSONDecoder() { 11 | super(65535, 0, 4, 0, 4); 12 | } 13 | 14 | protected Object decode(ChannelHandlerContext ctx, ByteBuf in) throws Exception { 15 | ByteBuf decode = (ByteBuf) super.decode(ctx, in); 16 | if (decode == null) { 17 | return null; 18 | } 19 | int data_len = decode.readableBytes(); 20 | byte[] bytes = new byte[data_len]; 21 | decode.readBytes(bytes); 22 | Object parse = JSON.parse(bytes); 23 | return parse; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-common/src/main/java/com/antzuhl/zeus/utils/JSONEncoder.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.utils; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import io.netty.buffer.ByteBuf; 5 | import io.netty.buffer.ByteBufAllocator; 6 | import io.netty.channel.ChannelHandlerContext; 7 | import io.netty.handler.codec.MessageToMessageEncoder; 8 | 9 | import java.util.List; 10 | 11 | public class JSONEncoder extends MessageToMessageEncoder { 12 | @Override 13 | protected void encode(ChannelHandlerContext channelHandlerContext, Object msg, List out) { 14 | ByteBuf byteBuf = ByteBufAllocator.DEFAULT.ioBuffer(); 15 | byte[] bytes = JSON.toJSONBytes(msg); 16 | byteBuf.writeInt(bytes.length); 17 | byteBuf.writeBytes(bytes); 18 | out.add(byteBuf); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-core/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | zeus-code 7 | com.antzuhl.zeus 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | zeus-core 13 | 14 | 15 | 16 | org.apache.maven.plugins 17 | maven-compiler-plugin 18 | 19 | 8 20 | 8 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | com.antzuhl.zeus 29 | zeus-common 30 | 1.0-SNAPSHOT 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-core/src/main/java/com/antzuhl/zeus/annotation/RateLimit.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.annotation; 2 | 3 | import com.antzuhl.zeus.config.AutoConfiguration; 4 | import com.antzuhl.zeus.config.InterceptorConfig; 5 | import com.antzuhl.zeus.config.ServerConfig; 6 | import com.antzuhl.zeus.limit.RateLimitFilter; 7 | import com.antzuhl.zeus.properties.PropertySourcesPlaceholderConfigurerBean; 8 | import org.springframework.context.annotation.Import; 9 | 10 | import java.lang.annotation.*; 11 | 12 | @Inherited 13 | @Target({ElementType.TYPE, ElementType.METHOD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Import({AutoConfiguration.class, 16 | RateLimitFilter.class, 17 | ServerConfig.class, 18 | AnnotationImport.class, 19 | InterceptorConfig.class}) 20 | @Documented 21 | public @interface RateLimit { 22 | int num() default Integer.MAX_VALUE; 23 | } 24 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-core/src/main/java/com/antzuhl/zeus/annotation/RpcService.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.annotation; 2 | 3 | import com.antzuhl.zeus.server.NettyServer; 4 | import org.springframework.context.annotation.Import; 5 | import org.springframework.stereotype.Component; 6 | 7 | import java.lang.annotation.ElementType; 8 | import java.lang.annotation.Retention; 9 | import java.lang.annotation.RetentionPolicy; 10 | import java.lang.annotation.Target; 11 | 12 | @Target({ElementType.TYPE}) 13 | @Retention(RetentionPolicy.RUNTIME) 14 | @Import(NettyServer.class) 15 | @Component 16 | public @interface RpcService { 17 | } -------------------------------------------------------------------------------- /zeus-discovery/zeus-core/src/main/java/com/antzuhl/zeus/annotation/ZeusProperty.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.annotation; 2 | 3 | import com.antzuhl.zeus.api.ClientAuditLogController; 4 | import com.antzuhl.zeus.api.ServiceAliveController; 5 | import com.antzuhl.zeus.config.ServerConfig; 6 | import com.antzuhl.zeus.event.TaskApplicationListener; 7 | import org.springframework.context.annotation.Import; 8 | import org.springframework.stereotype.Component; 9 | 10 | import java.lang.annotation.*; 11 | 12 | @Inherited 13 | @Target({ElementType.TYPE}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Import({ServiceAliveController.class, TaskApplicationListener.class, 16 | ClientAuditLogController.class}) 17 | @Component 18 | public @interface ZeusProperty { 19 | String serverAddr(); // 管理端的ip地址 20 | 21 | String serverName() default ""; 22 | 23 | String comment() default ""; 24 | } 25 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-core/src/main/java/com/antzuhl/zeus/api/ServiceAliveController.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.api; 2 | 3 | import com.antzuhl.zeus.annotation.AnnotationImport; 4 | import com.antzuhl.zeus.entity.ServiceInfo; 5 | import com.antzuhl.zeus.result.GenericJsonResult; 6 | import com.antzuhl.zeus.result.HResult; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | @RestController 11 | @RequestMapping(value = "/zeus/service") 12 | public class ServiceAliveController { 13 | 14 | @RequestMapping("/ping") 15 | public GenericJsonResult ping() { 16 | GenericJsonResult result = new GenericJsonResult<>(); 17 | result.setCode(HResult.R_ALIVE); 18 | ServiceInfo info = new ServiceInfo(); 19 | info.setServiceName(AnnotationImport.getApplicationServerName()); 20 | info.setServiceAddr(AnnotationImport.getApplicationServerAddr()); 21 | info.setComment(AnnotationImport.getApplicationServerComment()); 22 | info.setLiving(1); 23 | result.setMessage(HResult.valueOfString(HResult.R_ALIVE.getCode())); 24 | result.setData(info); 25 | return result; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-core/src/main/java/com/antzuhl/zeus/config/AutoConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | 5 | @Configuration 6 | public class AutoConfiguration { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-core/src/main/java/com/antzuhl/zeus/config/InterceptorConfig.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.config; 2 | 3 | import com.antzuhl.zeus.filter.AuditLogInterceptor; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 7 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 8 | 9 | @Configuration 10 | public class InterceptorConfig implements WebMvcConfigurer { 11 | 12 | @Override 13 | public void addInterceptors(InterceptorRegistry registry) { 14 | registry.addInterceptor(new AuditLogInterceptor()); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-core/src/main/java/com/antzuhl/zeus/dao/AuditLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.dao; 2 | 3 | import com.antzuhl.zeus.beans.AuditLog; 4 | 5 | import java.util.List; 6 | 7 | public interface AuditLogMapper { 8 | int deleteByPrimaryKey(String id); 9 | 10 | int insert(AuditLog record); 11 | 12 | int insertSelective(AuditLog record); 13 | 14 | AuditLog selectByPrimaryKey(String id); 15 | 16 | int updateByPrimaryKeySelective(AuditLog record); 17 | 18 | int updateByPrimaryKey(AuditLog record); 19 | 20 | List queryAll(); 21 | 22 | List getNoAccessAuditLogs(); 23 | 24 | int ruleOut(String id); 25 | 26 | int createTable(); 27 | } 28 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-core/src/main/java/com/antzuhl/zeus/dao/MapperFactory.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.dao; 2 | 3 | import com.antzuhl.zeus.framework.SqlResourceFactory; 4 | import org.apache.ibatis.session.SqlSession; 5 | 6 | import java.sql.SQLException; 7 | 8 | public class MapperFactory { 9 | 10 | private static SqlSession sqlSession = null; 11 | 12 | static { 13 | sqlSession = new SqlResourceFactory().getSqlSession(); 14 | try { 15 | sqlSession.getConnection().setAutoCommit(true); 16 | } catch (SQLException e) { 17 | e.printStackTrace(); 18 | } 19 | } 20 | 21 | public static AuditLogMapper auditLogMapper = sqlSession.getMapper(AuditLogMapper.class); 22 | } 23 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-core/src/main/java/com/antzuhl/zeus/dao/ServiceInfoMapper.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.dao; 2 | 3 | import com.antzuhl.zeus.entity.ServiceInfo; 4 | 5 | public interface ServiceInfoMapper { 6 | int deleteByPrimaryKey(Integer serviceId); 7 | 8 | int insert(ServiceInfo record); 9 | 10 | int insertSelective(ServiceInfo record); 11 | 12 | ServiceInfo selectByPrimaryKey(Integer serviceId); 13 | 14 | int updateByPrimaryKeySelective(ServiceInfo record); 15 | 16 | int updateByPrimaryKey(ServiceInfo record); 17 | } -------------------------------------------------------------------------------- /zeus-discovery/zeus-core/src/main/java/com/antzuhl/zeus/event/ServiceDiscovery.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.event; 2 | 3 | import com.antzuhl.zeus.entity.Service; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | import java.util.concurrent.ConcurrentHashMap; 8 | 9 | public class ServiceDiscovery { 10 | 11 | private static ConcurrentHashMap discovery = new ConcurrentHashMap<>(); 12 | 13 | private ServiceDiscovery() { 14 | } 15 | 16 | public static ServiceDiscovery getInstance() { 17 | return IMPORTCLASS.serviceDiscovery; 18 | } 19 | 20 | public void put(String name, Service service) { 21 | discovery.put(name, service); 22 | } 23 | 24 | public Service get(String name) { 25 | return discovery.get(name); 26 | } 27 | 28 | public boolean contains(String name) { 29 | return discovery.contains(name); 30 | } 31 | 32 | public List getAll() { 33 | List result = new ArrayList<>(); 34 | discovery.forEach((key, value)-> { 35 | result.add(value); 36 | }); 37 | return result; 38 | } 39 | 40 | private static class IMPORTCLASS { 41 | public static ServiceDiscovery serviceDiscovery = new ServiceDiscovery(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-core/src/main/java/com/antzuhl/zeus/framework/SpringContextUtil.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.framework; 2 | 3 | import org.springframework.beans.BeansException; 4 | import org.springframework.context.ApplicationContext; 5 | import org.springframework.context.ApplicationContextAware; 6 | 7 | public class SpringContextUtil implements ApplicationContextAware { 8 | 9 | private static ApplicationContext context; 10 | private static String applicationName; 11 | 12 | @Override 13 | @SuppressWarnings("static-access") 14 | public void setApplicationContext(ApplicationContext contex) throws BeansException { 15 | this.context = contex; 16 | applicationName = contex.getApplicationName(); 17 | } 18 | 19 | public static Object getBean(String beanName) { 20 | return context.getBean(beanName); 21 | } 22 | 23 | public static String getApplicationName() { 24 | return applicationName; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-core/src/main/java/com/antzuhl/zeus/limit/RateLimitFilter.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.limit; 2 | 3 | import com.antzuhl.zeus.annotation.AnnotationImport; 4 | import org.springframework.http.HttpStatus; 5 | import org.springframework.stereotype.Component; 6 | import org.springframework.web.filter.OncePerRequestFilter; 7 | 8 | import javax.servlet.FilterChain; 9 | import javax.servlet.ServletException; 10 | import javax.servlet.http.HttpServletRequest; 11 | import javax.servlet.http.HttpServletResponse; 12 | import java.io.IOException; 13 | 14 | @Component 15 | public class RateLimitFilter extends OncePerRequestFilter { 16 | 17 | protected void doFilterInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, FilterChain filterChain) throws ServletException, IOException { 18 | if (AnnotationImport.rateLimiter.tryAcquire()) { 19 | filterChain.doFilter(httpServletRequest, httpServletResponse); 20 | } else { 21 | httpServletResponse.setStatus(HttpStatus.TOO_MANY_REQUESTS.value()); 22 | httpServletResponse.getWriter().write("too many request\n"); 23 | httpServletResponse.getWriter().flush(); 24 | return; 25 | } 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-core/src/main/java/com/antzuhl/zeus/properties/BeanUtils.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.properties; 2 | 3 | import org.springframework.context.ApplicationContext; 4 | 5 | public class BeanUtils { 6 | private static ApplicationContext context; 7 | 8 | public static void setContext(ApplicationContext context) { 9 | BeanUtils.context = context; 10 | } 11 | 12 | public static ApplicationContext getContext() { 13 | return context; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-core/src/main/java/com/antzuhl/zeus/properties/PropertySourcesPlaceholderConfigurerBean.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.properties; 2 | 3 | 4 | import org.springframework.stereotype.Component; 5 | 6 | 7 | @Component 8 | public class PropertySourcesPlaceholderConfigurerBean { 9 | // @Bean 10 | // public PropertySourcesPlaceholderConfigurer yaml() { 11 | // PropertySourcesPlaceholderConfigurer configurer = new PropertySourcesPlaceholderConfigurer(); 12 | // YamlPropertiesFactoryBean yaml = new YamlPropertiesFactoryBean(); 13 | // yaml.setResources(new ClassPathResource("application-route.yml")); 14 | // configurer.setProperties(Objects.requireNonNull(yaml.getObject())); 15 | // return configurer; 16 | // } 17 | } 18 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-core/src/main/java/com/antzuhl/zeus/properties/RouteProperties.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.properties; 2 | 3 | public class RouteProperties { 4 | } 5 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-core/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: demoapp -------------------------------------------------------------------------------- /zeus-discovery/zeus-core/src/main/resources/myBatis-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-core/zeus-core.iml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-example/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | zeus-code 7 | com.antzuhl.zeus 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | zeus-example 13 | 14 | 15 | 16 | org.apache.maven.plugins 17 | maven-compiler-plugin 18 | 19 | 7 20 | 7 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | com.antzuhl.zeus 31 | zeus-core 32 | 1.0-SNAPSHOT 33 | compile 34 | 35 | 36 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-example/src/main/java/com/demo/DemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.demo; 2 | 3 | import com.antzuhl.zeus.annotation.RateLimit; 4 | import com.antzuhl.zeus.annotation.ZeusProperty; 5 | import org.springframework.boot.ApplicationArguments; 6 | import org.springframework.boot.ApplicationRunner; 7 | import org.springframework.boot.SpringApplication; 8 | import org.springframework.boot.autoconfigure.SpringBootApplication; 9 | 10 | 11 | @SpringBootApplication 12 | @ZeusProperty(serverName = "domain", serverAddr = "127.0.0.1", comment = "管理服务") 13 | @RateLimit(num = 1) 14 | public class DemoApplication implements ApplicationRunner { 15 | 16 | public static void main(String[] args) { 17 | SpringApplication.run(DemoApplication.class, args); 18 | } 19 | 20 | public void run(ApplicationArguments args) throws Exception { 21 | System.out.println("1"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-example/src/main/java/com/demo/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.demo.controller; 2 | 3 | import org.springframework.web.bind.annotation.PathVariable; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | import java.sql.SQLException; 8 | 9 | @RestController 10 | @RequestMapping("/users") 11 | public class UserController { 12 | 13 | 14 | @RequestMapping("/{id}") 15 | public String hello(@PathVariable Long id) throws SQLException { 16 | return id.toString(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-example/src/main/java/com/demo/service/DoSomething.java: -------------------------------------------------------------------------------- 1 | package com.demo.service; 2 | 3 | import java.util.List; 4 | 5 | public interface DoSomething { 6 | List doHello(); 7 | } 8 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-example/src/main/java/com/demo/service/DoSomethingImpl.java: -------------------------------------------------------------------------------- 1 | package com.demo.service; 2 | 3 | import com.antzuhl.zeus.annotation.RpcService; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | @RpcService 9 | public class DoSomethingImpl implements DoSomething { 10 | private static List users = new ArrayList<>(); 11 | 12 | @Override 13 | public List doHello() { 14 | users.add("user-1"); 15 | users.add("user-2"); 16 | users.add("user-3"); 17 | return users; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-example/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8888 3 | spring: 4 | application: 5 | name: demoapp -------------------------------------------------------------------------------- /zeus-discovery/zeus-example/target/classes/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8888 3 | spring: 4 | application: 5 | name: demoapp -------------------------------------------------------------------------------- /zeus-discovery/zeus-example/zeus-example.iml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-rpc-example/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | zeus-code 7 | com.antzuhl.zeus 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | zeus-rpc-example 13 | 14 | 15 | 16 | com.antzuhl.zeus 17 | zeus-core 18 | 1.0-SNAPSHOT 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-rpc-example/src/main/java/com/demo/RpcApplication.java: -------------------------------------------------------------------------------- 1 | package com.demo; 2 | 3 | import com.antzuhl.zeus.annotation.RateLimit; 4 | import com.antzuhl.zeus.annotation.ZeusProperty; 5 | import org.springframework.boot.ApplicationArguments; 6 | import org.springframework.boot.ApplicationRunner; 7 | import org.springframework.boot.SpringApplication; 8 | import org.springframework.boot.autoconfigure.SpringBootApplication; 9 | 10 | 11 | @SpringBootApplication 12 | @ZeusProperty(serverName = "RpcDemo", serverAddr = "127.0.0.1", comment = "远程服务") 13 | @RateLimit(num = 200) 14 | public class RpcApplication implements ApplicationRunner { 15 | 16 | public static void main(String[] args) { 17 | SpringApplication.run(RpcApplication.class, args); 18 | } 19 | 20 | public void run(ApplicationArguments args) throws Exception { 21 | System.out.println("1"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-rpc-example/src/main/java/com/demo/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.demo.controller; 2 | 3 | import com.antzuhl.zeus.client.RpcClient; 4 | import com.antzuhl.zeus.entity.request.RpcRequest; 5 | import org.springframework.web.bind.annotation.PathVariable; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | import java.sql.SQLException; 10 | 11 | @RestController 12 | @RequestMapping("/users") 13 | public class UserController { 14 | 15 | @RequestMapping(value = "/hello") 16 | public String hello() throws InterruptedException { 17 | RpcClient rpcClient = RpcClient.getInstance(); 18 | rpcClient.doConnect("localhost", 18868); 19 | Object object = rpcClient.send( 20 | new RpcRequest("1", 21 | "com.demo.service.DoSomethingImpl", 22 | "doHello", null, null)); 23 | 24 | return object.toString(); 25 | } 26 | 27 | @RequestMapping("/{id}") 28 | public String hello(@PathVariable Long id) throws SQLException { 29 | return id.toString(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-rpc-example/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8881 3 | spring: 4 | application: 5 | name: rpcdemo -------------------------------------------------------------------------------- /zeus-discovery/zeus-rpc-example/target/classes/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8881 3 | spring: 4 | application: 5 | name: rpcdemo -------------------------------------------------------------------------------- /zeus-discovery/zeus-server/src/main/java/com/antzuhl/zeus/ZeusServerApplication.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ZeusServerApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ZeusServerApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-server/src/main/java/com/antzuhl/zeus/api/AuditLogController.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.api; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | /** 7 | * 日志收集接口 8 | */ 9 | @RestController 10 | @RequestMapping(value = "/zeus-server/auditlog") 11 | public class AuditLogController { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-server/src/main/java/com/antzuhl/zeus/api/request/ServiceRequest.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.api.request; 2 | 3 | import com.antzuhl.zeus.beans.Service; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class ServiceRequest { 8 | private Long serviceId; 9 | private String serviceName; 10 | private String serviceAddr; 11 | private Integer port; 12 | private String comment; 13 | 14 | public Service toData() { 15 | Service service = new Service(); 16 | service.setId(null); 17 | service.setServiceName(getServiceName()); 18 | service.setServiceAddr(getServiceAddr() + ":" + port); 19 | service.setComment(getComment()); 20 | return service; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-server/src/main/java/com/antzuhl/zeus/api/response/ServiceInfoResponce.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.api.response; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class ServiceInfoResponce { 7 | private Long id; 8 | private String serviceName; 9 | private String serviceAddr; 10 | private Integer living; 11 | private String comment; 12 | } 13 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-server/src/main/java/com/antzuhl/zeus/beans/AuditLog.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.beans; 2 | 3 | import lombok.Data; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | import javax.persistence.Entity; 8 | import javax.persistence.GeneratedValue; 9 | import javax.persistence.GenerationType; 10 | import javax.persistence.Id; 11 | import java.util.Date; 12 | 13 | 14 | @Data 15 | @Getter 16 | @Setter 17 | @Entity 18 | public class AuditLog { 19 | @Id 20 | @GeneratedValue(strategy = GenerationType.AUTO) 21 | private Long id; 22 | private String logId; 23 | private Date createTime; 24 | private Date modifyTime; 25 | private String method; 26 | private String path; 27 | private String useTime; 28 | private Integer status; 29 | } 30 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-server/src/main/java/com/antzuhl/zeus/beans/Service.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.beans; 2 | 3 | import lombok.Data; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | import javax.persistence.*; 8 | 9 | @Data 10 | @Getter 11 | @Setter 12 | @Entity 13 | public class Service { 14 | 15 | @Id 16 | @GeneratedValue(strategy = GenerationType.AUTO) 17 | private Long id; 18 | private String serviceName; 19 | private String serviceAddr; 20 | private Integer port; 21 | private Integer living; 22 | private String comment; 23 | } 24 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-server/src/main/java/com/antzuhl/zeus/config/SQLiteDialectIdentityColumnSupport.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.config; 2 | 3 | import org.hibernate.dialect.Dialect; 4 | import org.hibernate.dialect.identity.IdentityColumnSupportImpl; 5 | 6 | 7 | public class SQLiteDialectIdentityColumnSupport extends IdentityColumnSupportImpl { 8 | public SQLiteDialectIdentityColumnSupport(Dialect dialect) { 9 | super(); 10 | } 11 | 12 | @Override 13 | public boolean supportsIdentityColumns() { 14 | return true; 15 | } 16 | 17 | /* 18 | public boolean supportsInsertSelectIdentity() { 19 | return true; // As specified in NHibernate dialect 20 | } 21 | */ 22 | 23 | @Override 24 | public boolean hasDataTypeInIdentityColumn() { 25 | // As specified in NHibernate dialect 26 | // FIXME true 27 | return false; 28 | } 29 | 30 | /* 31 | public String appendIdentitySelectToInsert(String insertString) { 32 | return new StringBuffer(insertString.length()+30). // As specified in NHibernate dialect 33 | append(insertString). 34 | append("; ").append(getIdentitySelectString()). 35 | toString(); 36 | } 37 | */ 38 | 39 | @Override 40 | public String getIdentitySelectString(String table, String column, int type) { 41 | return "select last_insert_rowid()"; 42 | } 43 | 44 | @Override 45 | public String getIdentityColumnString(int type) { 46 | // return "integer primary key autoincrement"; 47 | // FIXME "autoincrement" 48 | return "integer"; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-server/src/main/java/com/antzuhl/zeus/config/ServiceAliveTask.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.config; 2 | 3 | public class ServiceAliveTask { 4 | } 5 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-server/src/main/java/com/antzuhl/zeus/oauth/OAuth2AuthorizationServer.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.oauth; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 6 | import org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer; 7 | import org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter; 8 | import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer; 9 | 10 | //授权服务器配置 11 | @Configuration 12 | @EnableAuthorizationServer 13 | public class OAuth2AuthorizationServer extends AuthorizationServerConfigurerAdapter { 14 | 15 | @Autowired 16 | private BCryptPasswordEncoder passwordEncoder; 17 | 18 | @Override 19 | public void configure(ClientDetailsServiceConfigurer clients) throws Exception { 20 | clients.inMemory().withClient("zeus-server").secret(passwordEncoder.encode("zeus")) 21 | .redirectUris("http://localhost:9001/callback") 22 | // 授权码模式 23 | .authorizedGrantTypes("authorization_code").scopes("read_userinfo", "read_contacts"); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-server/src/main/java/com/antzuhl/zeus/oauth/OAuth2ResourceServer.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.oauth; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; 5 | import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer; 6 | import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter; 7 | 8 | //资源服务配置 9 | @Configuration 10 | @EnableResourceServer 11 | public class OAuth2ResourceServer extends ResourceServerConfigurerAdapter { 12 | 13 | @Override 14 | public void configure(HttpSecurity http) throws Exception { 15 | http.authorizeRequests() 16 | .anyRequest() 17 | .authenticated() 18 | .and() 19 | .requestMatchers() 20 | .antMatchers("/**"); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-server/src/main/java/com/antzuhl/zeus/oauth/SecurityConfig.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.oauth; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; 6 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; 7 | import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; 8 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 9 | 10 | @Configuration 11 | public class SecurityConfig extends WebSecurityConfigurerAdapter { 12 | @Override 13 | protected void configure(HttpSecurity http) throws Exception { // @formatter:off 14 | http.requestMatchers().antMatchers("/login", "/oauth/authorize").and().authorizeRequests().anyRequest() 15 | .authenticated().and().formLogin().permitAll().and().csrf().disable(); 16 | } // @formatter:on 17 | 18 | @Override 19 | protected void configure(AuthenticationManagerBuilder auth) throws Exception { // @formatter:off 20 | auth.inMemoryAuthentication().withUser("zeus").password(passwordEncoder().encode("zeus")).roles("USER"); 21 | } // @formatter:on 22 | // 23 | @Bean 24 | public BCryptPasswordEncoder passwordEncoder() { 25 | return new BCryptPasswordEncoder(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-server/src/main/java/com/antzuhl/zeus/registory/AuditLogRegistory.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.registory; 2 | 3 | import com.antzuhl.zeus.beans.AuditLog; 4 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 5 | import org.springframework.data.repository.CrudRepository; 6 | 7 | public interface AuditLogRegistory extends JpaSpecificationExecutor, CrudRepository { 8 | } -------------------------------------------------------------------------------- /zeus-discovery/zeus-server/src/main/java/com/antzuhl/zeus/registory/ServiceRegistory.java: -------------------------------------------------------------------------------- 1 | package com.antzuhl.zeus.registory; 2 | 3 | import com.antzuhl.zeus.beans.Service; 4 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 5 | import org.springframework.data.repository.CrudRepository; 6 | 7 | public interface ServiceRegistory extends JpaSpecificationExecutor, CrudRepository { 8 | Service findByServiceName(String serviceName); 9 | } -------------------------------------------------------------------------------- /zeus-discovery/zeus-server/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: zeus-server 4 | datasource: 5 | url: jdbc:sqlite:c:\\zeus-server.sqlite3 6 | driver-class-name: org.sqlite.JDBC 7 | username: 8 | password: 9 | jpa: 10 | hibernate: 11 | ddl-auto: update 12 | generate-ddl: true 13 | show-sql: true 14 | database-platform: com.antzuhl.zeus.config.SQLiteDialect 15 | # security: 16 | # user: 17 | # name: zeus 18 | # password: zeus 19 | server: 20 | port: 7777 21 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-server/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=INFO,CONSOLE 2 | log4j.addivity.org.apache=true 3 | # console 4 | log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender 5 | log4j.appender.CONSOLE.Threshold=INFO 6 | log4j.appender.CONSOLE.Target=System.out 7 | log4j.appender.CONSOLE.Encoding=UTF-8 8 | log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout 9 | log4j.appender.CONSOLE.layout.ConversionPattern=[SOCKET] %-5p %d{yyyy-MM-dd HH\:mm\:ss} - %C.%M(%L)[%t] - %m%n 10 | # all 11 | log4j.logger.com.demo=INFO, DEMO 12 | log4j.appender.DEMO=org.apache.log4j.RollingFileAppender 13 | log4j.appender.DEMO.File=${catalina.base}/logs/demo.log 14 | log4j.appender.DEMO.MaxFileSize=50MB 15 | log4j.appender.DEMO.MaxBackupIndex=3 16 | log4j.appender.DEMO.Encoding=UTF-8 17 | log4j.appender.DEMO.layout=org.apache.log4j.PatternLayout 18 | log4j.appender.DEMO.layout.ConversionPattern=[demo] %-5p %d{yyyy-MM-dd HH\:mm\:ss} - %C.%M(%L)[%t] - %m%n 19 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-server/target/classes/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: zeus-server 4 | datasource: 5 | url: jdbc:sqlite:c:\\zeus-server.sqlite3 6 | driver-class-name: org.sqlite.JDBC 7 | username: 8 | password: 9 | jpa: 10 | hibernate: 11 | ddl-auto: update 12 | generate-ddl: true 13 | show-sql: true 14 | database-platform: com.antzuhl.zeus.config.SQLiteDialect 15 | server: 16 | port: 7777 17 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-server/target/classes/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=INFO,CONSOLE 2 | log4j.addivity.org.apache=true 3 | # console 4 | log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender 5 | log4j.appender.CONSOLE.Threshold=INFO 6 | log4j.appender.CONSOLE.Target=System.out 7 | log4j.appender.CONSOLE.Encoding=UTF-8 8 | log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout 9 | log4j.appender.CONSOLE.layout.ConversionPattern=[SOCKET] %-5p %d{yyyy-MM-dd HH\:mm\:ss} - %C.%M(%L)[%t] - %m%n 10 | # all 11 | log4j.logger.com.demo=INFO, DEMO 12 | log4j.appender.DEMO=org.apache.log4j.RollingFileAppender 13 | log4j.appender.DEMO.File=${catalina.base}/logs/demo.log 14 | log4j.appender.DEMO.MaxFileSize=50MB 15 | log4j.appender.DEMO.MaxBackupIndex=3 16 | log4j.appender.DEMO.Encoding=UTF-8 17 | log4j.appender.DEMO.layout=org.apache.log4j.PatternLayout 18 | log4j.appender.DEMO.layout.ConversionPattern=[demo] %-5p %d{yyyy-MM-dd HH\:mm\:ss} - %C.%M(%L)[%t] - %m%n 19 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-server/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CasterWx/Zeus/4187c50f13aa3ea041d60677a17fb147fe42100e/zeus-discovery/zeus-server/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst -------------------------------------------------------------------------------- /zeus-discovery/zeus-server/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst: -------------------------------------------------------------------------------- 1 | D:\zeus-code\zeus-server\src\main\java\com\antzuhl\zeus\config\SQLiteDialectIdentityColumnSupport.java 2 | D:\zeus-code\zeus-server\src\main\java\com\antzuhl\zeus\api\request\ServiceRequest.java 3 | D:\zeus-code\zeus-server\src\main\java\com\antzuhl\zeus\registory\ServiceRegistory.java 4 | D:\zeus-code\zeus-server\src\main\java\com\antzuhl\zeus\beans\Service.java 5 | D:\zeus-code\zeus-server\src\main\java\com\antzuhl\zeus\config\ServiceAliveTask.java 6 | D:\zeus-code\zeus-server\src\main\java\com\antzuhl\zeus\config\SQLiteDialect.java 7 | D:\zeus-code\zeus-server\src\main\java\com\antzuhl\zeus\api\response\ServiceInfoResponce.java 8 | D:\zeus-code\zeus-server\src\main\java\com\antzuhl\zeus\beans\AuditLog.java 9 | D:\zeus-code\zeus-server\src\main\java\com\antzuhl\zeus\api\ServiceController.java 10 | D:\zeus-code\zeus-server\src\main\java\com\antzuhl\zeus\config\ZeusApplicationListener.java 11 | D:\zeus-code\zeus-server\src\main\java\com\antzuhl\zeus\ZeusServerApplication.java 12 | D:\zeus-code\zeus-server\src\main\java\com\antzuhl\zeus\api\AuditLogController.java 13 | D:\zeus-code\zeus-server\src\main\java\com\antzuhl\zeus\registory\AuditLogRegistory.java 14 | -------------------------------------------------------------------------------- /zeus-discovery/zeus-server/zeus-server.iml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /zeus-discovery/zeus.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CasterWx/Zeus/4187c50f13aa3ea041d60677a17fb147fe42100e/zeus-discovery/zeus.sqlite3 -------------------------------------------------------------------------------- /zeus-discovery/zeus2.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CasterWx/Zeus/4187c50f13aa3ea041d60677a17fb147fe42100e/zeus-discovery/zeus2.sqlite3 --------------------------------------------------------------------------------