├── .DS_Store ├── Dockerfile ├── LICENSE ├── README.md ├── build.bat ├── cmd ├── .DS_Store ├── add.go └── web.go ├── conf ├── .DS_Store └── conf.ini ├── data └── .DS_Store ├── log └── .DS_Store ├── main.go ├── model ├── .DS_S ├── .DS_Store ├── core.go ├── product.go ├── struct.go └── user.go ├── modules ├── .DS_Store ├── init │ └── init2.go ├── log │ ├── .DS_Store │ ├── file.go │ └── log.go └── temfuc │ └── render.go ├── nssm └── nssm.exe ├── public ├── .DS_Store ├── css │ ├── .DS_Store │ └── normalize.css ├── img │ ├── .DS_Store │ ├── login_bg.png │ ├── login_block_bg.png │ ├── login_block_top_bg.png │ ├── login_btn.png │ ├── spinner_no.png │ └── spinner_ok.png ├── jatoolsPrinter.cab ├── js │ ├── .DS_Store │ ├── html5.js │ ├── jquery.min.js │ ├── nano.js │ ├── pos.js │ └── respond.min.js ├── plugins │ ├── .DS_Store │ ├── bootstrap-3.3.0 │ │ ├── .DS_Store │ │ ├── css │ │ │ ├── .DS_Store │ │ │ └── bootstrap.min.css │ │ ├── fonts │ │ │ ├── .DS_Store │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ └── glyphicons-halflings-regular.woff │ │ └── js │ │ │ ├── .DS_Store │ │ │ └── bootstrap.min.js │ ├── font-awesome-4.6.3 │ │ ├── .DS_Store │ │ ├── css │ │ │ ├── .DS_Store │ │ │ ├── font-awesome.css │ │ │ ├── font-awesome.css.map │ │ │ └── font-awesome.min.css │ │ └── fonts │ │ │ ├── .DS_Store │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.svg │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ └── fontawesome-webfont.woff2 │ ├── highcharts │ │ ├── .DS_Store │ │ ├── exporting.js │ │ └── highcharts.js │ ├── jquery.autocomplete │ │ ├── autocomplete.css │ │ └── jquery.autocomplete.js │ ├── jquery.bootgrid-1.3.1 │ │ ├── .DS_Store │ │ ├── jquery.bootgrid.min.css │ │ └── jquery.bootgrid.min.js │ ├── pinyin │ │ ├── firstletter.js │ │ ├── notone.js │ │ └── pinyinUtil.js │ └── toastr │ │ ├── .DS_Store │ │ ├── toastr.min.css │ │ └── toastr.min.js └── setup.exe ├── routers ├── .DS_Store ├── crm │ ├── .DS_Store │ ├── crm.go │ ├── muser │ │ └── user.go │ ├── order │ │ ├── .DS_Store │ │ └── order.go │ ├── product │ │ └── product.go │ └── producttype │ │ └── producttype.go ├── pos │ ├── pos.go │ ├── print.go │ └── struct.go ├── report │ ├── pos.go │ └── strut.go ├── routers.go └── user │ ├── .DS_Store │ └── login.go ├── snapshot ├── .DS_Store ├── alipay.jpeg ├── alipay.png ├── pdt.png ├── pos.png └── wpay.png ├── vendor ├── github.com │ ├── BurntSushi │ │ └── toml │ │ │ ├── COMPATIBLE │ │ │ ├── COPYING │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── decode.go │ │ │ ├── decode_meta.go │ │ │ ├── doc.go │ │ │ ├── encode.go │ │ │ ├── encoding_types.go │ │ │ ├── encoding_types_1.1.go │ │ │ ├── lex.go │ │ │ ├── parse.go │ │ │ ├── session.vim │ │ │ ├── type_check.go │ │ │ └── type_fields.go │ ├── Unknwon │ │ └── com │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── cmd.go │ │ │ ├── convert.go │ │ │ ├── dir.go │ │ │ ├── file.go │ │ │ ├── html.go │ │ │ ├── http.go │ │ │ ├── math.go │ │ │ ├── path.go │ │ │ ├── regex.go │ │ │ ├── slice.go │ │ │ ├── string.go │ │ │ ├── time.go │ │ │ └── url.go │ ├── boltdb │ │ └── bolt │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── appveyor.yml │ │ │ ├── bolt_386.go │ │ │ ├── bolt_amd64.go │ │ │ ├── bolt_arm.go │ │ │ ├── bolt_arm64.go │ │ │ ├── bolt_linux.go │ │ │ ├── bolt_openbsd.go │ │ │ ├── bolt_ppc.go │ │ │ ├── bolt_ppc64.go │ │ │ ├── bolt_ppc64le.go │ │ │ ├── bolt_s390x.go │ │ │ ├── bolt_unix.go │ │ │ ├── bolt_unix_solaris.go │ │ │ ├── bolt_windows.go │ │ │ ├── boltsync_unix.go │ │ │ ├── bucket.go │ │ │ ├── cursor.go │ │ │ ├── db.go │ │ │ ├── doc.go │ │ │ ├── errors.go │ │ │ ├── freelist.go │ │ │ ├── node.go │ │ │ ├── page.go │ │ │ └── tx.go │ ├── codegangsta │ │ └── cli │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── app.go │ │ │ ├── appveyor.yml │ │ │ ├── category.go │ │ │ ├── cli.go │ │ │ ├── command.go │ │ │ ├── context.go │ │ │ ├── flag.go │ │ │ └── help.go │ ├── cupcake │ │ └── rdb │ │ │ ├── LICENCE │ │ │ ├── README.md │ │ │ ├── crc64 │ │ │ └── crc64.go │ │ │ ├── decoder.go │ │ │ ├── encoder.go │ │ │ ├── nopdecoder │ │ │ └── nop_decoder.go │ │ │ └── slice_buffer.go │ ├── edsrzf │ │ └── mmap-go │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── mmap.go │ │ │ ├── mmap_unix.go │ │ │ └── mmap_windows.go │ ├── go-macaron │ │ ├── cache │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── cache.go │ │ │ ├── file.go │ │ │ ├── ledis │ │ │ │ ├── ledis.go │ │ │ │ └── ledis.goconvey │ │ │ ├── memory.go │ │ │ └── utils.go │ │ ├── captcha │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── captcha.go │ │ │ ├── image.go │ │ │ └── siprng.go │ │ ├── inject │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── inject.go │ │ └── session │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── file.go │ │ │ ├── memory.go │ │ │ ├── session.go │ │ │ └── utils.go │ ├── go-xorm │ │ ├── builder │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── builder.go │ │ │ ├── builder_delete.go │ │ │ ├── builder_insert.go │ │ │ ├── builder_select.go │ │ │ ├── builder_update.go │ │ │ ├── cond.go │ │ │ ├── cond_and.go │ │ │ ├── cond_between.go │ │ │ ├── cond_compare.go │ │ │ ├── cond_eq.go │ │ │ ├── cond_expr.go │ │ │ ├── cond_in.go │ │ │ ├── cond_like.go │ │ │ ├── cond_neq.go │ │ │ ├── cond_not.go │ │ │ ├── cond_notin.go │ │ │ ├── cond_null.go │ │ │ ├── cond_or.go │ │ │ ├── doc.go │ │ │ ├── error.go │ │ │ └── set.go │ │ ├── core │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── benchmark.sh │ │ │ ├── cache.go │ │ │ ├── column.go │ │ │ ├── converstion.go │ │ │ ├── db.go │ │ │ ├── dialect.go │ │ │ ├── driver.go │ │ │ ├── error.go │ │ │ ├── filter.go │ │ │ ├── ilogger.go │ │ │ ├── index.go │ │ │ ├── mapper.go │ │ │ ├── pk.go │ │ │ ├── rows.go │ │ │ ├── scan.go │ │ │ ├── table.go │ │ │ └── type.go │ │ └── xorm │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── README_CN.md │ │ │ ├── VERSION │ │ │ ├── doc.go │ │ │ ├── engine.go │ │ │ ├── error.go │ │ │ ├── gen_reserved.sh │ │ │ ├── goracle_driver.go │ │ │ ├── helpers.go │ │ │ ├── logger.go │ │ │ ├── lru_cacher.go │ │ │ ├── memory_store.go │ │ │ ├── mssql_dialect.go │ │ │ ├── mymysql_driver.go │ │ │ ├── mysql_dialect.go │ │ │ ├── mysql_driver.go │ │ │ ├── oci8_driver.go │ │ │ ├── odbc_driver.go │ │ │ ├── oracle_dialect.go │ │ │ ├── pg_reserved.txt │ │ │ ├── postgres_dialect.go │ │ │ ├── pq_driver.go │ │ │ ├── processors.go │ │ │ ├── rows.go │ │ │ ├── session.go │ │ │ ├── sqlite3_dialect.go │ │ │ ├── sqlite3_driver.go │ │ │ ├── statement.go │ │ │ ├── syslogger.go │ │ │ ├── types.go │ │ │ └── xorm.go │ ├── golang │ │ └── snappy │ │ │ ├── AUTHORS │ │ │ ├── CONTRIBUTORS │ │ │ ├── LICENSE │ │ │ ├── README │ │ │ ├── decode.go │ │ │ ├── decode_amd64.go │ │ │ ├── decode_amd64.s │ │ │ ├── decode_other.go │ │ │ ├── encode.go │ │ │ ├── encode_amd64.go │ │ │ ├── encode_amd64.s │ │ │ ├── encode_other.go │ │ │ └── snappy.go │ ├── guregu │ │ └── null │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── bool.go │ │ │ ├── float.go │ │ │ ├── int.go │ │ │ ├── string.go │ │ │ └── time.go │ ├── jmoiron │ │ └── sqlx │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── bind.go │ │ │ ├── doc.go │ │ │ ├── named.go │ │ │ ├── named_context.go │ │ │ ├── reflectx │ │ │ ├── README.md │ │ │ └── reflect.go │ │ │ ├── sqlx.go │ │ │ └── sqlx_context.go │ ├── mattn │ │ └── go-sqlite3 │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── backup.go │ │ │ ├── callback.go │ │ │ ├── doc.go │ │ │ ├── error.go │ │ │ ├── sqlite3-binding.c │ │ │ ├── sqlite3-binding.h │ │ │ ├── sqlite3.go │ │ │ ├── sqlite3_fts5.go │ │ │ ├── sqlite3_icu.go │ │ │ ├── sqlite3_json1.go │ │ │ ├── sqlite3_libsqlite3.go │ │ │ ├── sqlite3_load_extension.go │ │ │ ├── sqlite3_omit_load_extension.go │ │ │ ├── sqlite3_other.go │ │ │ ├── sqlite3_windows.go │ │ │ ├── sqlite3ext.h │ │ │ ├── tracecallback.go │ │ │ └── tracecallback_noimpl.go │ ├── siddontang │ │ ├── go │ │ │ ├── LICENSE │ │ │ ├── filelock │ │ │ │ ├── LICENSE │ │ │ │ ├── file_lock_generic.go │ │ │ │ ├── file_lock_solaris.go │ │ │ │ ├── file_lock_unix.go │ │ │ │ └── file_lock_windows.go │ │ │ ├── hack │ │ │ │ └── hack.go │ │ │ ├── ioutil2 │ │ │ │ ├── ioutil.go │ │ │ │ └── sectionwriter.go │ │ │ ├── log │ │ │ │ ├── doc.go │ │ │ │ ├── filehandler.go │ │ │ │ ├── handler.go │ │ │ │ ├── log.go │ │ │ │ └── sockethandler.go │ │ │ ├── num │ │ │ │ ├── bytes.go │ │ │ │ ├── cmp.go │ │ │ │ └── str.go │ │ │ ├── snappy │ │ │ │ ├── LICENSE │ │ │ │ ├── decode.go │ │ │ │ ├── encode.go │ │ │ │ └── snappy.go │ │ │ └── sync2 │ │ │ │ ├── atomic.go │ │ │ │ └── semaphore.go │ │ ├── ledisdb │ │ │ ├── LICENSE │ │ │ ├── config │ │ │ │ ├── config.go │ │ │ │ └── config.toml │ │ │ ├── ledis │ │ │ │ ├── batch.go │ │ │ │ ├── const.go │ │ │ │ ├── doc.go │ │ │ │ ├── dump.go │ │ │ │ ├── event.go │ │ │ │ ├── ledis.go │ │ │ │ ├── ledis_db.go │ │ │ │ ├── migrate.go │ │ │ │ ├── multi.go │ │ │ │ ├── replication.go │ │ │ │ ├── scan.go │ │ │ │ ├── sort.go │ │ │ │ ├── t_bit.go │ │ │ │ ├── t_hash.go │ │ │ │ ├── t_kv.go │ │ │ │ ├── t_list.go │ │ │ │ ├── t_set.go │ │ │ │ ├── t_ttl.go │ │ │ │ ├── t_zset.go │ │ │ │ ├── tx.go │ │ │ │ └── util.go │ │ │ ├── rpl │ │ │ │ ├── file_io.go │ │ │ │ ├── file_store.go │ │ │ │ ├── file_table.go │ │ │ │ ├── goleveldb_store.go │ │ │ │ ├── log.go │ │ │ │ ├── rpl.go │ │ │ │ └── store.go │ │ │ └── store │ │ │ │ ├── boltdb │ │ │ │ ├── const.go │ │ │ │ ├── db.go │ │ │ │ ├── iterator.go │ │ │ │ ├── snapshot.go │ │ │ │ └── tx.go │ │ │ │ ├── db.go │ │ │ │ ├── driver │ │ │ │ ├── batch.go │ │ │ │ ├── driver.go │ │ │ │ ├── slice.go │ │ │ │ └── store.go │ │ │ │ ├── goleveldb │ │ │ │ ├── batch.go │ │ │ │ ├── const.go │ │ │ │ ├── db.go │ │ │ │ ├── iterator.go │ │ │ │ └── snapshot.go │ │ │ │ ├── iterator.go │ │ │ │ ├── leveldb │ │ │ │ ├── batch.go │ │ │ │ ├── cache.go │ │ │ │ ├── const.go │ │ │ │ ├── db.go │ │ │ │ ├── filterpolicy.go │ │ │ │ ├── iterator.go │ │ │ │ ├── leveldb_ext.cc │ │ │ │ ├── leveldb_ext.h │ │ │ │ ├── levigo-license │ │ │ │ ├── options.go │ │ │ │ ├── slice.go │ │ │ │ ├── snapshot.go │ │ │ │ └── util.go │ │ │ │ ├── mdb │ │ │ │ ├── const.go │ │ │ │ ├── influxdb_license │ │ │ │ ├── mdb.go │ │ │ │ ├── snapshot.go │ │ │ │ └── tx.go │ │ │ │ ├── rocksdb │ │ │ │ ├── batch.go │ │ │ │ ├── cache.go │ │ │ │ ├── const.go │ │ │ │ ├── db.go │ │ │ │ ├── env.go │ │ │ │ ├── filterpolicy.go │ │ │ │ ├── iterator.go │ │ │ │ ├── options.go │ │ │ │ ├── rocksdb_ext.cc │ │ │ │ ├── rocksdb_ext.h │ │ │ │ ├── slice.go │ │ │ │ ├── snapshot.go │ │ │ │ └── util.go │ │ │ │ ├── slice.go │ │ │ │ ├── snapshot.go │ │ │ │ ├── stat.go │ │ │ │ ├── store.go │ │ │ │ ├── tx.go │ │ │ │ └── writebatch.go │ │ └── rdb │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── decode.go │ │ │ ├── digest.go │ │ │ ├── encode.go │ │ │ ├── loader.go │ │ │ ├── reader.go │ │ │ └── wandoujia-license │ ├── syndtr │ │ └── goleveldb │ │ │ ├── LICENSE │ │ │ └── leveldb │ │ │ ├── batch.go │ │ │ ├── cache │ │ │ ├── cache.go │ │ │ └── lru.go │ │ │ ├── comparer.go │ │ │ ├── comparer │ │ │ ├── bytes_comparer.go │ │ │ └── comparer.go │ │ │ ├── db.go │ │ │ ├── db_compaction.go │ │ │ ├── db_iter.go │ │ │ ├── db_snapshot.go │ │ │ ├── db_state.go │ │ │ ├── db_transaction.go │ │ │ ├── db_util.go │ │ │ ├── db_write.go │ │ │ ├── doc.go │ │ │ ├── errors.go │ │ │ ├── errors │ │ │ └── errors.go │ │ │ ├── filter.go │ │ │ ├── filter │ │ │ ├── bloom.go │ │ │ └── filter.go │ │ │ ├── iterator │ │ │ ├── array_iter.go │ │ │ ├── indexed_iter.go │ │ │ ├── iter.go │ │ │ └── merged_iter.go │ │ │ ├── journal │ │ │ └── journal.go │ │ │ ├── key.go │ │ │ ├── memdb │ │ │ └── memdb.go │ │ │ ├── opt │ │ │ └── options.go │ │ │ ├── options.go │ │ │ ├── session.go │ │ │ ├── session_compaction.go │ │ │ ├── session_record.go │ │ │ ├── session_util.go │ │ │ ├── storage │ │ │ ├── file_storage.go │ │ │ ├── file_storage_plan9.go │ │ │ ├── file_storage_solaris.go │ │ │ ├── file_storage_unix.go │ │ │ ├── file_storage_windows.go │ │ │ ├── mem_storage.go │ │ │ └── storage.go │ │ │ ├── table.go │ │ │ ├── table │ │ │ ├── reader.go │ │ │ ├── table.go │ │ │ └── writer.go │ │ │ ├── util.go │ │ │ ├── util │ │ │ ├── buffer.go │ │ │ ├── buffer_pool.go │ │ │ ├── crc32.go │ │ │ ├── hash.go │ │ │ ├── range.go │ │ │ └── util.go │ │ │ └── version.go │ └── xuri │ │ └── excelize │ │ ├── CODE_OF_CONDUCT.md │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── cell.go │ │ ├── chart.go │ │ ├── col.go │ │ ├── comment.go │ │ ├── date.go │ │ ├── excelize.go │ │ ├── excelize.png │ │ ├── file.go │ │ ├── lib.go │ │ ├── picture.go │ │ ├── rows.go │ │ ├── shape.go │ │ ├── sheet.go │ │ ├── styles.go │ │ ├── table.go │ │ ├── templates.go │ │ ├── vmlDrawing.go │ │ ├── xmlChart.go │ │ ├── xmlComments.go │ │ ├── xmlContentTypes.go │ │ ├── xmlDecodeDrawing.go │ │ ├── xmlDrawing.go │ │ ├── xmlSharedStrings.go │ │ ├── xmlStyles.go │ │ ├── xmlTable.go │ │ ├── xmlWorkbook.go │ │ └── xmlWorksheet.go ├── golang.org │ └── x │ │ ├── LICENSE │ │ ├── PATENTS │ │ └── sys │ │ ├── LICENSE │ │ ├── PATENTS │ │ └── unix │ │ ├── README.md │ │ ├── affinity_linux.go │ │ ├── asm_darwin_386.s │ │ ├── asm_darwin_amd64.s │ │ ├── asm_darwin_arm.s │ │ ├── asm_darwin_arm64.s │ │ ├── asm_dragonfly_amd64.s │ │ ├── asm_freebsd_386.s │ │ ├── asm_freebsd_amd64.s │ │ ├── asm_freebsd_arm.s │ │ ├── asm_linux_386.s │ │ ├── asm_linux_amd64.s │ │ ├── asm_linux_arm.s │ │ ├── asm_linux_arm64.s │ │ ├── asm_linux_mips64x.s │ │ ├── asm_linux_mipsx.s │ │ ├── asm_linux_ppc64x.s │ │ ├── asm_linux_s390x.s │ │ ├── asm_netbsd_386.s │ │ ├── asm_netbsd_amd64.s │ │ ├── asm_netbsd_arm.s │ │ ├── asm_openbsd_386.s │ │ ├── asm_openbsd_amd64.s │ │ ├── asm_openbsd_arm.s │ │ ├── asm_solaris_amd64.s │ │ ├── bluetooth_linux.go │ │ ├── cap_freebsd.go │ │ ├── constants.go │ │ ├── dev_darwin.go │ │ ├── dev_dragonfly.go │ │ ├── dev_freebsd.go │ │ ├── dev_linux.go │ │ ├── dev_netbsd.go │ │ ├── dev_openbsd.go │ │ ├── dirent.go │ │ ├── endian_big.go │ │ ├── endian_little.go │ │ ├── env_unix.go │ │ ├── errors_freebsd_386.go │ │ ├── errors_freebsd_amd64.go │ │ ├── errors_freebsd_arm.go │ │ ├── flock.go │ │ ├── flock_linux_32bit.go │ │ ├── gccgo.go │ │ ├── gccgo_c.c │ │ ├── gccgo_linux_amd64.go │ │ ├── mkall.sh │ │ ├── mkerrors.sh │ │ ├── mkpost.go │ │ ├── mksyscall.pl │ │ ├── mksyscall_solaris.pl │ │ ├── mksysctl_openbsd.pl │ │ ├── mksysnum_darwin.pl │ │ ├── mksysnum_dragonfly.pl │ │ ├── mksysnum_freebsd.pl │ │ ├── mksysnum_netbsd.pl │ │ ├── mksysnum_openbsd.pl │ │ ├── openbsd_pledge.go │ │ ├── pagesize_unix.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── sockcmsg_linux.go │ │ ├── sockcmsg_unix.go │ │ ├── str.go │ │ ├── syscall.go │ │ ├── syscall_bsd.go │ │ ├── syscall_darwin.go │ │ ├── syscall_darwin_386.go │ │ ├── syscall_darwin_amd64.go │ │ ├── syscall_darwin_arm.go │ │ ├── syscall_darwin_arm64.go │ │ ├── syscall_dragonfly.go │ │ ├── syscall_dragonfly_amd64.go │ │ ├── syscall_freebsd.go │ │ ├── syscall_freebsd_386.go │ │ ├── syscall_freebsd_amd64.go │ │ ├── syscall_freebsd_arm.go │ │ ├── syscall_linux.go │ │ ├── syscall_linux_386.go │ │ ├── syscall_linux_amd64.go │ │ ├── syscall_linux_amd64_gc.go │ │ ├── syscall_linux_arm.go │ │ ├── syscall_linux_arm64.go │ │ ├── syscall_linux_mips64x.go │ │ ├── syscall_linux_mipsx.go │ │ ├── syscall_linux_ppc64x.go │ │ ├── syscall_linux_s390x.go │ │ ├── syscall_linux_sparc64.go │ │ ├── syscall_netbsd.go │ │ ├── syscall_netbsd_386.go │ │ ├── syscall_netbsd_amd64.go │ │ ├── syscall_netbsd_arm.go │ │ ├── syscall_openbsd.go │ │ ├── syscall_openbsd_386.go │ │ ├── syscall_openbsd_amd64.go │ │ ├── syscall_openbsd_arm.go │ │ ├── syscall_solaris.go │ │ ├── syscall_solaris_amd64.go │ │ ├── syscall_unix.go │ │ ├── syscall_unix_gc.go │ │ ├── timestruct.go │ │ ├── types_darwin.go │ │ ├── types_dragonfly.go │ │ ├── types_freebsd.go │ │ ├── types_netbsd.go │ │ ├── types_openbsd.go │ │ ├── types_solaris.go │ │ ├── zerrors_darwin_386.go │ │ ├── zerrors_darwin_amd64.go │ │ ├── zerrors_darwin_arm.go │ │ ├── zerrors_darwin_arm64.go │ │ ├── zerrors_dragonfly_amd64.go │ │ ├── zerrors_freebsd_386.go │ │ ├── zerrors_freebsd_amd64.go │ │ ├── zerrors_freebsd_arm.go │ │ ├── zerrors_linux_386.go │ │ ├── zerrors_linux_amd64.go │ │ ├── zerrors_linux_arm.go │ │ ├── zerrors_linux_arm64.go │ │ ├── zerrors_linux_mips.go │ │ ├── zerrors_linux_mips64.go │ │ ├── zerrors_linux_mips64le.go │ │ ├── zerrors_linux_mipsle.go │ │ ├── zerrors_linux_ppc64.go │ │ ├── zerrors_linux_ppc64le.go │ │ ├── zerrors_linux_s390x.go │ │ ├── zerrors_linux_sparc64.go │ │ ├── zerrors_netbsd_386.go │ │ ├── zerrors_netbsd_amd64.go │ │ ├── zerrors_netbsd_arm.go │ │ ├── zerrors_openbsd_386.go │ │ ├── zerrors_openbsd_amd64.go │ │ ├── zerrors_openbsd_arm.go │ │ ├── zerrors_solaris_amd64.go │ │ ├── zptrace386_linux.go │ │ ├── zptracearm_linux.go │ │ ├── zptracemips_linux.go │ │ ├── zptracemipsle_linux.go │ │ ├── zsyscall_darwin_386.go │ │ ├── zsyscall_darwin_amd64.go │ │ ├── zsyscall_darwin_arm.go │ │ ├── zsyscall_darwin_arm64.go │ │ ├── zsyscall_dragonfly_amd64.go │ │ ├── zsyscall_freebsd_386.go │ │ ├── zsyscall_freebsd_amd64.go │ │ ├── zsyscall_freebsd_arm.go │ │ ├── zsyscall_linux_386.go │ │ ├── zsyscall_linux_amd64.go │ │ ├── zsyscall_linux_arm.go │ │ ├── zsyscall_linux_arm64.go │ │ ├── zsyscall_linux_mips.go │ │ ├── zsyscall_linux_mips64.go │ │ ├── zsyscall_linux_mips64le.go │ │ ├── zsyscall_linux_mipsle.go │ │ ├── zsyscall_linux_ppc64.go │ │ ├── zsyscall_linux_ppc64le.go │ │ ├── zsyscall_linux_s390x.go │ │ ├── zsyscall_linux_sparc64.go │ │ ├── zsyscall_netbsd_386.go │ │ ├── zsyscall_netbsd_amd64.go │ │ ├── zsyscall_netbsd_arm.go │ │ ├── zsyscall_openbsd_386.go │ │ ├── zsyscall_openbsd_amd64.go │ │ ├── zsyscall_openbsd_arm.go │ │ ├── zsyscall_solaris_amd64.go │ │ ├── zsysctl_openbsd_386.go │ │ ├── zsysctl_openbsd_amd64.go │ │ ├── zsysctl_openbsd_arm.go │ │ ├── zsysnum_darwin_386.go │ │ ├── zsysnum_darwin_amd64.go │ │ ├── zsysnum_darwin_arm.go │ │ ├── zsysnum_darwin_arm64.go │ │ ├── zsysnum_dragonfly_amd64.go │ │ ├── zsysnum_freebsd_386.go │ │ ├── zsysnum_freebsd_amd64.go │ │ ├── zsysnum_freebsd_arm.go │ │ ├── zsysnum_linux_386.go │ │ ├── zsysnum_linux_amd64.go │ │ ├── zsysnum_linux_arm.go │ │ ├── zsysnum_linux_arm64.go │ │ ├── zsysnum_linux_mips.go │ │ ├── zsysnum_linux_mips64.go │ │ ├── zsysnum_linux_mips64le.go │ │ ├── zsysnum_linux_mipsle.go │ │ ├── zsysnum_linux_ppc64.go │ │ ├── zsysnum_linux_ppc64le.go │ │ ├── zsysnum_linux_s390x.go │ │ ├── zsysnum_linux_sparc64.go │ │ ├── zsysnum_netbsd_386.go │ │ ├── zsysnum_netbsd_amd64.go │ │ ├── zsysnum_netbsd_arm.go │ │ ├── zsysnum_openbsd_386.go │ │ ├── zsysnum_openbsd_amd64.go │ │ ├── zsysnum_openbsd_arm.go │ │ ├── ztypes_darwin_386.go │ │ ├── ztypes_darwin_amd64.go │ │ ├── ztypes_darwin_arm.go │ │ ├── ztypes_darwin_arm64.go │ │ ├── ztypes_dragonfly_amd64.go │ │ ├── ztypes_freebsd_386.go │ │ ├── ztypes_freebsd_amd64.go │ │ ├── ztypes_freebsd_arm.go │ │ ├── ztypes_linux_386.go │ │ ├── ztypes_linux_amd64.go │ │ ├── ztypes_linux_arm.go │ │ ├── ztypes_linux_arm64.go │ │ ├── ztypes_linux_mips.go │ │ ├── ztypes_linux_mips64.go │ │ ├── ztypes_linux_mips64le.go │ │ ├── ztypes_linux_mipsle.go │ │ ├── ztypes_linux_ppc64.go │ │ ├── ztypes_linux_ppc64le.go │ │ ├── ztypes_linux_s390x.go │ │ ├── ztypes_linux_sparc64.go │ │ ├── ztypes_netbsd_386.go │ │ ├── ztypes_netbsd_amd64.go │ │ ├── ztypes_netbsd_arm.go │ │ ├── ztypes_openbsd_386.go │ │ ├── ztypes_openbsd_amd64.go │ │ ├── ztypes_openbsd_arm.go │ │ └── ztypes_solaris_amd64.go ├── gomdb │ ├── LICENSE │ ├── README.md │ ├── cursor.go │ ├── env.go │ ├── lmdb.h │ ├── mdb.c │ ├── mdb.go │ ├── midl.c │ ├── midl.h │ ├── txn.go │ └── val.go ├── gopkg.in │ ├── ini.v1 │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── README_ZH.md │ │ ├── ini.go │ │ ├── key.go │ │ ├── parser.go │ │ ├── section.go │ │ └── struct.go │ └── macaron.v1 │ │ ├── LICENSE │ │ ├── README.md │ │ ├── context.go │ │ ├── logger.go │ │ ├── macaron.go │ │ ├── macaronlogo.png │ │ ├── recovery.go │ │ ├── render.go │ │ ├── response_writer.go │ │ ├── return_handler.go │ │ ├── router.go │ │ ├── static.go │ │ └── tree.go └── vendor.json ├── views ├── .DS_Store ├── crm │ ├── .DS_Store │ ├── comm │ │ ├── header.html │ │ ├── link.html │ │ └── script.html │ ├── order │ │ ├── .DS_Store │ │ ├── index.html │ │ └── item.html │ ├── product │ │ ├── .DS_Store │ │ └── index.html │ ├── producttype │ │ └── index.html │ └── user │ │ └── index.html ├── login.html ├── pos │ ├── .DS_Store │ ├── index.html │ └── print.html ├── report │ ├── .DS_Store │ └── index.html └── user │ ├── changepwd.html │ └── printsetting.html └── wix.json /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/.DS_Store -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ARG GO_VERSION=1.11 2 | FROM golang:${GO_VERSION} AS builder 3 | MAINTAINER <284077318@qq.com> 4 | COPY . $GOPATH/src/github.com/jicg/easypos 5 | WORKDIR $GOPATH/src/github.com/jicg/easypos 6 | #RUN apk add --no-cache git gcc 7 | RUN go get github.com/jicg/easypos 8 | RUN go install -a github.com/jicg/easypos 9 | 10 | FROM debian:latest AS final 11 | MAINTAINER <284077318@qq.com> 12 | COPY --from=builder /go/bin/easypos /usr/bin/easypos 13 | COPY --from=builder /go/src/github.com/jicg/easypos/views /app/views 14 | COPY --from=builder /go/src/github.com/jicg/easypos/public /app/public 15 | VOLUME /app/data 16 | VOLUME /app/log 17 | EXPOSE 4000 18 | WORKDIR /app 19 | RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ 20 | && echo 'Asia/Shanghai' >/etc/timezone \ 21 | && chmod +x start.sh 22 | CMD /usr/bin/easypos 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # easypos 2 | 简单收银系统(用于单体小店铺),个人业余时间用golang语言实现,如果您有更好的意见,可以提交issue。大家一起学习,一起讨论。 3 | #### 功能 4 | 1. 商品维护 5 | 2. 创建订单 6 | 3. 查询订单 7 | 4. 库存控制 8 | 9 | #### 界面截图 10 | 1. 商品维护界面 11 | ![商品维护界面](snapshot/pdt.png "商品维护界面") 12 | 2. 收银界面的截图 13 | ![收银界面](snapshot/pos.png "收银界面") 14 | 15 | 16 | --- 17 | 18 | #### 项目使用的框架 19 | * [macaron](https://github.com/go-macaron/macaron) 20 | * [xorm](https://github.com/go-xorm/xorm) 21 | -------------------------------------------------------------------------------- /build.bat: -------------------------------------------------------------------------------- 1 | go build -ldflags="-w -s" 2 | upx easypos.exe 3 | go-msi make --msi easypos.msi --version 0.0.2 -------------------------------------------------------------------------------- /cmd/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/cmd/.DS_Store -------------------------------------------------------------------------------- /cmd/add.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "github.com/codegangsta/cli" 5 | ) 6 | 7 | var CmdAdd = cli.Command{ 8 | Name: "add", 9 | Usage: "自动添加模版", 10 | Description: ``, 11 | Action: runAdd, 12 | Flags: []cli.Flag{ 13 | cli.StringFlag{ 14 | Name: "action", 15 | Value: "", 16 | Usage: "动作", 17 | }, 18 | }, 19 | } 20 | 21 | func runAdd(ctx *cli.Context) { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /conf/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/conf/.DS_Store -------------------------------------------------------------------------------- /conf/conf.ini: -------------------------------------------------------------------------------- 1 | [database] 2 | #db_host=127.0.0.1 3 | #db_port=3306 4 | #db_user=root 5 | #db_pass=123 6 | #db_name=easypos 7 | #dbprefix="" 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /data/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/data/.DS_Store -------------------------------------------------------------------------------- /log/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/log/.DS_Store -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "os" 5 | 6 | "github.com/codegangsta/cli" 7 | "github.com/jicg/easypos/cmd" 8 | ) 9 | 10 | func main() { 11 | app := cli.NewApp() 12 | app.Commands = []cli.Command{ 13 | cmd.CmdWeb, 14 | cmd.CmdAdd, 15 | } 16 | if len(os.Args) <= 1 { 17 | os.Args = []string{"./easypos", "web"} 18 | } 19 | app.Run(os.Args) 20 | } 21 | -------------------------------------------------------------------------------- /model/.DS_S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/model/.DS_S -------------------------------------------------------------------------------- /model/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/model/.DS_Store -------------------------------------------------------------------------------- /model/product.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | func AddProduct(pro *Product) error { 4 | _, err := Engine.InsertOne(pro) 5 | return err 6 | } 7 | 8 | 9 | func AddProductType(pro *Producttype) error { 10 | _, err := Engine.InsertOne(pro) 11 | return err 12 | } -------------------------------------------------------------------------------- /model/user.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | func GetUserByNameWithPwd(name string, pwd string) *User { 4 | user := new(User) 5 | Engine.Where(" name = ? ", name).And(" pwd = ? ", pwd).Get(user) 6 | return user 7 | } 8 | 9 | func GetUserCount() (int64, error) { 10 | return Engine.Count(new(User)) 11 | } 12 | -------------------------------------------------------------------------------- /modules/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/modules/.DS_Store -------------------------------------------------------------------------------- /modules/log/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/modules/log/.DS_Store -------------------------------------------------------------------------------- /nssm/nssm.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/nssm/nssm.exe -------------------------------------------------------------------------------- /public/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/public/.DS_Store -------------------------------------------------------------------------------- /public/css/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/public/css/.DS_Store -------------------------------------------------------------------------------- /public/img/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/public/img/.DS_Store -------------------------------------------------------------------------------- /public/img/login_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/public/img/login_bg.png -------------------------------------------------------------------------------- /public/img/login_block_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/public/img/login_block_bg.png -------------------------------------------------------------------------------- /public/img/login_block_top_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/public/img/login_block_top_bg.png -------------------------------------------------------------------------------- /public/img/login_btn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/public/img/login_btn.png -------------------------------------------------------------------------------- /public/img/spinner_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/public/img/spinner_no.png -------------------------------------------------------------------------------- /public/img/spinner_ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/public/img/spinner_ok.png -------------------------------------------------------------------------------- /public/jatoolsPrinter.cab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/public/jatoolsPrinter.cab -------------------------------------------------------------------------------- /public/js/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/public/js/.DS_Store -------------------------------------------------------------------------------- /public/js/nano.js: -------------------------------------------------------------------------------- 1 | function nano(template, data) { 2 | return template.replace(/\{([\w\.]*)\}/g, function(str, key) { 3 | var keys = key.split("."), v = data[keys.shift()]; 4 | for (var i = 0, l = keys.length; i < l; i++) v = v[keys[i]]; 5 | return (typeof v !== "undefined" && v !== null) ? v : ""; 6 | }); 7 | } -------------------------------------------------------------------------------- /public/plugins/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/public/plugins/.DS_Store -------------------------------------------------------------------------------- /public/plugins/bootstrap-3.3.0/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/public/plugins/bootstrap-3.3.0/.DS_Store -------------------------------------------------------------------------------- /public/plugins/bootstrap-3.3.0/css/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/public/plugins/bootstrap-3.3.0/css/.DS_Store -------------------------------------------------------------------------------- /public/plugins/bootstrap-3.3.0/fonts/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/public/plugins/bootstrap-3.3.0/fonts/.DS_Store -------------------------------------------------------------------------------- /public/plugins/bootstrap-3.3.0/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/public/plugins/bootstrap-3.3.0/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /public/plugins/bootstrap-3.3.0/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/public/plugins/bootstrap-3.3.0/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /public/plugins/bootstrap-3.3.0/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/public/plugins/bootstrap-3.3.0/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /public/plugins/bootstrap-3.3.0/js/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/public/plugins/bootstrap-3.3.0/js/.DS_Store -------------------------------------------------------------------------------- /public/plugins/font-awesome-4.6.3/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/public/plugins/font-awesome-4.6.3/.DS_Store -------------------------------------------------------------------------------- /public/plugins/font-awesome-4.6.3/css/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/public/plugins/font-awesome-4.6.3/css/.DS_Store -------------------------------------------------------------------------------- /public/plugins/font-awesome-4.6.3/fonts/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/public/plugins/font-awesome-4.6.3/fonts/.DS_Store -------------------------------------------------------------------------------- /public/plugins/font-awesome-4.6.3/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/public/plugins/font-awesome-4.6.3/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /public/plugins/font-awesome-4.6.3/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/public/plugins/font-awesome-4.6.3/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /public/plugins/font-awesome-4.6.3/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/public/plugins/font-awesome-4.6.3/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /public/plugins/font-awesome-4.6.3/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/public/plugins/font-awesome-4.6.3/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /public/plugins/font-awesome-4.6.3/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/public/plugins/font-awesome-4.6.3/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /public/plugins/highcharts/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/public/plugins/highcharts/.DS_Store -------------------------------------------------------------------------------- /public/plugins/jquery.autocomplete/autocomplete.css: -------------------------------------------------------------------------------- 1 | .autocomplete-suggestions { 2 | -webkit-box-sizing: border-box; 3 | -moz-box-sizing: border-box; 4 | box-sizing: border-box; 5 | border: 1px solid #999; 6 | background: #fff; 7 | cursor: default; 8 | overflow: auto; 9 | -webkit-box-shadow: 1px 4px 3px rgba(50,50,50,.64); 10 | -moz-box-shadow: 1px 4px 3px rgba(50,50,50,.64); 11 | box-shadow: 1px 4px 3px rgba(50,50,50,.64) 12 | } 13 | 14 | .autocomplete-suggestion { 15 | padding: 2px 5px; 16 | white-space: nowrap; 17 | overflow: hidden 18 | } 19 | 20 | .autocomplete-no-suggestion { 21 | padding: 2px 5px 22 | } 23 | 24 | .autocomplete-selected { 25 | background: #f0f0f0 26 | } 27 | 28 | .autocomplete-suggestions strong { 29 | font-weight: 700; 30 | color: #000 31 | } 32 | 33 | .autocomplete-group { 34 | padding: 2px 5px 35 | } 36 | 37 | .autocomplete-group strong { 38 | font-weight: 700; 39 | font-size: 16px; 40 | color: #000; 41 | display: block; 42 | border-bottom: 1px solid #000 43 | } -------------------------------------------------------------------------------- /public/plugins/jquery.bootgrid-1.3.1/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/public/plugins/jquery.bootgrid-1.3.1/.DS_Store -------------------------------------------------------------------------------- /public/plugins/toastr/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/public/plugins/toastr/.DS_Store -------------------------------------------------------------------------------- /public/setup.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/public/setup.exe -------------------------------------------------------------------------------- /routers/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/routers/.DS_Store -------------------------------------------------------------------------------- /routers/crm/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/routers/crm/.DS_Store -------------------------------------------------------------------------------- /routers/crm/crm.go: -------------------------------------------------------------------------------- 1 | package crm 2 | 3 | import ( 4 | "github.com/go-macaron/session" 5 | "gopkg.in/macaron.v1" 6 | "github.com/jicg/easypos/model" 7 | ) 8 | 9 | type RetJson struct { 10 | Code int64 `json:"code"` 11 | Msg string `json:"msg"` 12 | Data interface{} `json:"data"` 13 | } 14 | 15 | type RowDatas struct { 16 | Current int `json:"current"` 17 | RowCount int `json:"rowCount"` 18 | Rows interface{} `json:"rows"` 19 | Total int64 `json:"total"` 20 | } 21 | 22 | func LoginCheck(ctx *macaron.Context, sess session.Store) { 23 | user := sess.Get("USER") 24 | if user == nil { 25 | ctx.JSON(200, &RetJson{Code: -1, Msg: "用户没登录!"}) 26 | return 27 | } else { 28 | ctx.Data["user"] = user 29 | } 30 | } 31 | 32 | func CheckAdmin(ctx *macaron.Context) { 33 | user := ctx.Data["user"] 34 | if user == nil { 35 | ctx.JSON(200, &RetJson{Code: -1, Msg: "用户没登录!"}) 36 | return 37 | } 38 | u := user.(*model.User) 39 | if !u.IsAdmin { 40 | ctx.JSON(200, &RetJson{Code: -1, Msg: "权限不足!"}) 41 | return 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /routers/crm/order/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/routers/crm/order/.DS_Store -------------------------------------------------------------------------------- /routers/pos/struct.go: -------------------------------------------------------------------------------- 1 | package pos 2 | 3 | type RetData struct { 4 | Code int `json:"code"` 5 | Msg string `json:"msg"` 6 | Data interface{} `json:"data"` 7 | } 8 | -------------------------------------------------------------------------------- /routers/report/pos.go: -------------------------------------------------------------------------------- 1 | package report 2 | 3 | import ( 4 | "github.com/jicg/easypos/model" 5 | "gopkg.in/macaron.v1" 6 | "log" 7 | "strconv" 8 | ) 9 | 10 | type PosSale struct { 11 | Name string `json:"name"` 12 | Data []float64 `json:"data"` 13 | } 14 | 15 | func PosIndex(ctx *macaron.Context) { 16 | rets, err := model.Engine.Query(`select no,totqty,totamt,proamt from 17 | (select a.product_desc as no,sum(a.qty) as totqty, sum(a.trueprice*a.qty) as totamt ,sum((a.trueprice-b.price)*a.qty) as proamt 18 | from order_item a ,product b 19 | where strftime("%Y-%m",a.cdate) = strftime("%Y-%m",'now') 20 | and a.product_no = b.no 21 | group by a.product_no ) order by proamt desc limit 8 22 | `) 23 | if err != nil { 24 | log.Println("错误:%v\n", err) 25 | } 26 | nos := make([]string, 0) 27 | totamts := make([]float64, 0) 28 | proamts := make([]float64, 0) 29 | for i := 0; i < len(rets); i++ { 30 | ret := rets[i] 31 | nos = append(nos, string(ret["no"])) 32 | v1, err := strconv.ParseFloat(string(ret["totamt"]), 64) 33 | if err != nil { 34 | v1 = float64(0) 35 | } 36 | totamts = append(totamts, v1) 37 | 38 | v2, err := strconv.ParseFloat(string(ret["proamt"]), 64) 39 | if err != nil { 40 | v2 = float64(0) 41 | } 42 | proamts = append(proamts, v2) 43 | } 44 | ctx.Data["categories"] = nos 45 | ctx.Data["datas"] = [...]*PosSale{{Name: "总金额", Data: totamts}, {Name: "收益金额", Data: proamts}} 46 | ctx.HTML(200, "report/index") 47 | } 48 | -------------------------------------------------------------------------------- /routers/report/strut.go: -------------------------------------------------------------------------------- 1 | package report 2 | -------------------------------------------------------------------------------- /routers/routers.go: -------------------------------------------------------------------------------- 1 | package routers 2 | 3 | import ( 4 | "gopkg.in/macaron.v1" 5 | ) 6 | 7 | func Index(ctx *macaron.Context) { 8 | ctx.Redirect("/view/pos") 9 | } 10 | -------------------------------------------------------------------------------- /routers/user/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/routers/user/.DS_Store -------------------------------------------------------------------------------- /snapshot/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/snapshot/.DS_Store -------------------------------------------------------------------------------- /snapshot/alipay.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/snapshot/alipay.jpeg -------------------------------------------------------------------------------- /snapshot/alipay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/snapshot/alipay.png -------------------------------------------------------------------------------- /snapshot/pdt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/snapshot/pdt.png -------------------------------------------------------------------------------- /snapshot/pos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/snapshot/pos.png -------------------------------------------------------------------------------- /snapshot/wpay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/snapshot/wpay.png -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/COMPATIBLE: -------------------------------------------------------------------------------- 1 | Compatible with TOML version 2 | [v0.2.0](https://github.com/mojombo/toml/blob/master/versions/toml-v0.2.0.md) 3 | 4 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/COPYING: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2004 Sam Hocevar 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | 15 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/Makefile: -------------------------------------------------------------------------------- 1 | install: 2 | go install ./... 3 | 4 | test: install 5 | go test -v 6 | toml-test toml-test-decoder 7 | toml-test -encoder toml-test-encoder 8 | 9 | fmt: 10 | gofmt -w *.go */*.go 11 | colcheck *.go */*.go 12 | 13 | tags: 14 | find ./ -name '*.go' -print0 | xargs -0 gotags > TAGS 15 | 16 | push: 17 | git push origin master 18 | git push github master 19 | 20 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package toml provides facilities for decoding and encoding TOML configuration 3 | files via reflection. There is also support for delaying decoding with 4 | the Primitive type, and querying the set of keys in a TOML document with the 5 | MetaData type. 6 | 7 | The specification implemented: https://github.com/mojombo/toml 8 | 9 | The sub-command github.com/BurntSushi/toml/cmd/tomlv can be used to verify 10 | whether a file is a valid TOML document. It can also be used to print the 11 | type of each key in a TOML document. 12 | 13 | Testing 14 | 15 | There are two important types of tests used for this package. The first is 16 | contained inside '*_test.go' files and uses the standard Go unit testing 17 | framework. These tests are primarily devoted to holistically testing the 18 | decoder and encoder. 19 | 20 | The second type of testing is used to verify the implementation's adherence 21 | to the TOML specification. These tests have been factored into their own 22 | project: https://github.com/BurntSushi/toml-test 23 | 24 | The reason the tests are in a separate project is so that they can be used by 25 | any implementation of TOML. Namely, it is language agnostic. 26 | */ 27 | package toml 28 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/encoding_types.go: -------------------------------------------------------------------------------- 1 | // +build go1.2 2 | 3 | package toml 4 | 5 | // In order to support Go 1.1, we define our own TextMarshaler and 6 | // TextUnmarshaler types. For Go 1.2+, we just alias them with the 7 | // standard library interfaces. 8 | 9 | import ( 10 | "encoding" 11 | ) 12 | 13 | // TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here 14 | // so that Go 1.1 can be supported. 15 | type TextMarshaler encoding.TextMarshaler 16 | 17 | // TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined 18 | // here so that Go 1.1 can be supported. 19 | type TextUnmarshaler encoding.TextUnmarshaler 20 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/encoding_types_1.1.go: -------------------------------------------------------------------------------- 1 | // +build !go1.2 2 | 3 | package toml 4 | 5 | // These interfaces were introduced in Go 1.2, so we add them manually when 6 | // compiling for Go 1.1. 7 | 8 | // TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here 9 | // so that Go 1.1 can be supported. 10 | type TextMarshaler interface { 11 | MarshalText() (text []byte, err error) 12 | } 13 | 14 | // TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined 15 | // here so that Go 1.1 can be supported. 16 | type TextUnmarshaler interface { 17 | UnmarshalText(text []byte) error 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/session.vim: -------------------------------------------------------------------------------- 1 | au BufWritePost *.go silent!make tags > /dev/null 2>&1 2 | -------------------------------------------------------------------------------- /vendor/github.com/Unknwon/com/README.md: -------------------------------------------------------------------------------- 1 | Common Functions 2 | ================ 3 | 4 | [![Build Status](https://travis-ci.org/Unknwon/com.svg)](https://travis-ci.org/Unknwon/com) [![Go Walker](http://gowalker.org/api/v1/badge)](http://gowalker.org/github.com/Unknwon/com) 5 | 6 | This is an open source project for commonly used functions for the Go programming language. 7 | 8 | This package need >= **go 1.2** 9 | 10 | Code Convention: based on [Go Code Convention](https://github.com/Unknwon/go-code-convention). 11 | 12 | ## Contribute 13 | 14 | Your contribute is welcome, but you have to check following steps after you added some functions and commit them: 15 | 16 | 1. Make sure you wrote user-friendly comments for **all functions** . 17 | 2. Make sure you wrote test cases with any possible condition for **all functions** in file `*_test.go`. 18 | 3. Make sure you wrote benchmarks for **all functions** in file `*_test.go`. 19 | 4. Make sure you wrote useful examples for **all functions** in file `example_test.go`. 20 | 5. Make sure you ran `go test` and got **PASS** . 21 | -------------------------------------------------------------------------------- /vendor/github.com/Unknwon/com/math.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 com authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | package com 16 | 17 | // PowInt is int type of math.Pow function. 18 | func PowInt(x int, y int) int { 19 | if y <= 0 { 20 | return 1 21 | } else { 22 | if y % 2 == 0 { 23 | sqrt := PowInt(x, y/2) 24 | return sqrt * sqrt 25 | } else { 26 | return PowInt(x, y-1) * x 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/Unknwon/com/url.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 com authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | package com 16 | 17 | import ( 18 | "encoding/base64" 19 | "net/url" 20 | ) 21 | 22 | // url encode string, is + not %20 23 | func UrlEncode(str string) string { 24 | return url.QueryEscape(str) 25 | } 26 | 27 | // url decode string 28 | func UrlDecode(str string) (string, error) { 29 | return url.QueryUnescape(str) 30 | } 31 | 32 | // base64 encode 33 | func Base64Encode(str string) string { 34 | return base64.StdEncoding.EncodeToString([]byte(str)) 35 | } 36 | 37 | // base64 decode 38 | func Base64Decode(str string) (string, error) { 39 | s, e := base64.StdEncoding.DecodeString(str) 40 | return string(s), e 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Ben Johnson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | 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, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/Makefile: -------------------------------------------------------------------------------- 1 | BRANCH=`git rev-parse --abbrev-ref HEAD` 2 | COMMIT=`git rev-parse --short HEAD` 3 | GOLDFLAGS="-X main.branch $(BRANCH) -X main.commit $(COMMIT)" 4 | 5 | default: build 6 | 7 | race: 8 | @go test -v -race -test.run="TestSimulate_(100op|1000op)" 9 | 10 | # go get github.com/kisielk/errcheck 11 | errcheck: 12 | @errcheck -ignorepkg=bytes -ignore=os:Remove github.com/boltdb/bolt 13 | 14 | test: 15 | @go test -v -cover . 16 | @go test -v ./cmd/bolt 17 | 18 | .PHONY: fmt test 19 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: "{build}" 2 | 3 | os: Windows Server 2012 R2 4 | 5 | clone_folder: c:\gopath\src\github.com\boltdb\bolt 6 | 7 | environment: 8 | GOPATH: c:\gopath 9 | 10 | install: 11 | - echo %PATH% 12 | - echo %GOPATH% 13 | - go version 14 | - go env 15 | - go get -v -t ./... 16 | 17 | build_script: 18 | - go test -v ./... 19 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_386.go: -------------------------------------------------------------------------------- 1 | package bolt 2 | 3 | // maxMapSize represents the largest mmap size supported by Bolt. 4 | const maxMapSize = 0x7FFFFFFF // 2GB 5 | 6 | // maxAllocSize is the size used when creating array pointers. 7 | const maxAllocSize = 0xFFFFFFF 8 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_amd64.go: -------------------------------------------------------------------------------- 1 | package bolt 2 | 3 | // maxMapSize represents the largest mmap size supported by Bolt. 4 | const maxMapSize = 0xFFFFFFFFFFFF // 256TB 5 | 6 | // maxAllocSize is the size used when creating array pointers. 7 | const maxAllocSize = 0x7FFFFFFF 8 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_arm.go: -------------------------------------------------------------------------------- 1 | package bolt 2 | 3 | // maxMapSize represents the largest mmap size supported by Bolt. 4 | const maxMapSize = 0x7FFFFFFF // 2GB 5 | 6 | // maxAllocSize is the size used when creating array pointers. 7 | const maxAllocSize = 0xFFFFFFF 8 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_arm64.go: -------------------------------------------------------------------------------- 1 | // +build arm64 2 | 3 | package bolt 4 | 5 | // maxMapSize represents the largest mmap size supported by Bolt. 6 | const maxMapSize = 0xFFFFFFFFFFFF // 256TB 7 | 8 | // maxAllocSize is the size used when creating array pointers. 9 | const maxAllocSize = 0x7FFFFFFF 10 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_linux.go: -------------------------------------------------------------------------------- 1 | package bolt 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | // fdatasync flushes written data to a file descriptor. 8 | func fdatasync(db *DB) error { 9 | return syscall.Fdatasync(int(db.file.Fd())) 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_openbsd.go: -------------------------------------------------------------------------------- 1 | package bolt 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | const ( 9 | msAsync = 1 << iota // perform asynchronous writes 10 | msSync // perform synchronous writes 11 | msInvalidate // invalidate cached data 12 | ) 13 | 14 | func msync(db *DB) error { 15 | _, _, errno := syscall.Syscall(syscall.SYS_MSYNC, uintptr(unsafe.Pointer(db.data)), uintptr(db.datasz), msInvalidate) 16 | if errno != 0 { 17 | return errno 18 | } 19 | return nil 20 | } 21 | 22 | func fdatasync(db *DB) error { 23 | if db.data != nil { 24 | return msync(db) 25 | } 26 | return db.file.Sync() 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_ppc.go: -------------------------------------------------------------------------------- 1 | // +build ppc 2 | 3 | package bolt 4 | 5 | // maxMapSize represents the largest mmap size supported by Bolt. 6 | const maxMapSize = 0x7FFFFFFF // 2GB 7 | 8 | // maxAllocSize is the size used when creating array pointers. 9 | const maxAllocSize = 0xFFFFFFF 10 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_ppc64.go: -------------------------------------------------------------------------------- 1 | // +build ppc64 2 | 3 | package bolt 4 | 5 | // maxMapSize represents the largest mmap size supported by Bolt. 6 | const maxMapSize = 0xFFFFFFFFFFFF // 256TB 7 | 8 | // maxAllocSize is the size used when creating array pointers. 9 | const maxAllocSize = 0x7FFFFFFF 10 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_ppc64le.go: -------------------------------------------------------------------------------- 1 | // +build ppc64le 2 | 3 | package bolt 4 | 5 | // maxMapSize represents the largest mmap size supported by Bolt. 6 | const maxMapSize = 0xFFFFFFFFFFFF // 256TB 7 | 8 | // maxAllocSize is the size used when creating array pointers. 9 | const maxAllocSize = 0x7FFFFFFF 10 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_s390x.go: -------------------------------------------------------------------------------- 1 | // +build s390x 2 | 3 | package bolt 4 | 5 | // maxMapSize represents the largest mmap size supported by Bolt. 6 | const maxMapSize = 0xFFFFFFFFFFFF // 256TB 7 | 8 | // maxAllocSize is the size used when creating array pointers. 9 | const maxAllocSize = 0x7FFFFFFF 10 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/boltsync_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows,!plan9,!linux,!openbsd 2 | 3 | package bolt 4 | 5 | // fdatasync flushes written data to a file descriptor. 6 | func fdatasync(db *DB) error { 7 | return db.file.Sync() 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/codegangsta/cli/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2013 Jeremy Saenz 2 | All Rights Reserved. 3 | 4 | MIT LICENSE 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/codegangsta/cli/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: "{build}" 2 | 3 | os: Windows Server 2012 R2 4 | 5 | install: 6 | - go version 7 | - go env 8 | 9 | build_script: 10 | - cd %APPVEYOR_BUILD_FOLDER% 11 | - go vet ./... 12 | - go test -v ./... 13 | 14 | test: off 15 | 16 | deploy: off 17 | -------------------------------------------------------------------------------- /vendor/github.com/codegangsta/cli/category.go: -------------------------------------------------------------------------------- 1 | package cli 2 | 3 | type CommandCategories []*CommandCategory 4 | 5 | type CommandCategory struct { 6 | Name string 7 | Commands Commands 8 | } 9 | 10 | func (c CommandCategories) Less(i, j int) bool { 11 | return c[i].Name < c[j].Name 12 | } 13 | 14 | func (c CommandCategories) Len() int { 15 | return len(c) 16 | } 17 | 18 | func (c CommandCategories) Swap(i, j int) { 19 | c[i], c[j] = c[j], c[i] 20 | } 21 | 22 | func (c CommandCategories) AddCommand(category string, command Command) CommandCategories { 23 | for _, commandCategory := range c { 24 | if commandCategory.Name == category { 25 | commandCategory.Commands = append(commandCategory.Commands, command) 26 | return c 27 | } 28 | } 29 | return append(c, &CommandCategory{Name: category, Commands: []Command{command}}) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/codegangsta/cli/cli.go: -------------------------------------------------------------------------------- 1 | // Package cli provides a minimal framework for creating and organizing command line 2 | // Go applications. cli is designed to be easy to understand and write, the most simple 3 | // cli application can be written as follows: 4 | // func main() { 5 | // cli.NewApp().Run(os.Args) 6 | // } 7 | // 8 | // Of course this application does not do much, so let's make this an actual application: 9 | // func main() { 10 | // app := cli.NewApp() 11 | // app.Name = "greet" 12 | // app.Usage = "say a greeting" 13 | // app.Action = func(c *cli.Context) { 14 | // println("Greetings") 15 | // } 16 | // 17 | // app.Run(os.Args) 18 | // } 19 | package cli 20 | 21 | import ( 22 | "strings" 23 | ) 24 | 25 | type MultiError struct { 26 | Errors []error 27 | } 28 | 29 | func NewMultiError(err ...error) MultiError { 30 | return MultiError{Errors: err} 31 | } 32 | 33 | func (m MultiError) Error() string { 34 | errs := make([]string, len(m.Errors)) 35 | for i, err := range m.Errors { 36 | errs[i] = err.Error() 37 | } 38 | 39 | return strings.Join(errs, "\n") 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/cupcake/rdb/LICENCE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Jonathan Rudenberg 2 | Copyright (c) 2012 Sripathi Krishnan 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/cupcake/rdb/README.md: -------------------------------------------------------------------------------- 1 | # rdb [![Build Status](https://travis-ci.org/cupcake/rdb.png?branch=master)](https://travis-ci.org/cupcake/rdb) 2 | 3 | rdb is a Go package that implements parsing and encoding of the 4 | [Redis](http://redis.io) [RDB file 5 | format](https://github.com/sripathikrishnan/redis-rdb-tools/blob/master/docs/RDB_File_Format.textile). 6 | 7 | This package was heavily inspired by 8 | [redis-rdb-tools](https://github.com/sripathikrishnan/redis-rdb-tools) by 9 | [Sripathi Krishnan](https://github.com/sripathikrishnan). 10 | 11 | [**Documentation**](http://godoc.org/github.com/cupcake/rdb) 12 | 13 | ## Installation 14 | 15 | ``` 16 | go get github.com/cupcake/rdb 17 | ``` 18 | -------------------------------------------------------------------------------- /vendor/github.com/cupcake/rdb/nopdecoder/nop_decoder.go: -------------------------------------------------------------------------------- 1 | package nopdecoder 2 | 3 | // NopDecoder may be embedded in a real Decoder to avoid implementing methods. 4 | type NopDecoder struct{} 5 | 6 | func (d NopDecoder) StartRDB() {} 7 | func (d NopDecoder) StartDatabase(n int) {} 8 | func (d NopDecoder) EndDatabase(n int) {} 9 | func (d NopDecoder) EndRDB() {} 10 | func (d NopDecoder) Set(key, value []byte, expiry int64) {} 11 | func (d NopDecoder) StartHash(key []byte, length, expiry int64) {} 12 | func (d NopDecoder) Hset(key, field, value []byte) {} 13 | func (d NopDecoder) EndHash(key []byte) {} 14 | func (d NopDecoder) StartSet(key []byte, cardinality, expiry int64) {} 15 | func (d NopDecoder) Sadd(key, member []byte) {} 16 | func (d NopDecoder) EndSet(key []byte) {} 17 | func (d NopDecoder) StartList(key []byte, length, expiry int64) {} 18 | func (d NopDecoder) Rpush(key, value []byte) {} 19 | func (d NopDecoder) EndList(key []byte) {} 20 | func (d NopDecoder) StartZSet(key []byte, cardinality, expiry int64) {} 21 | func (d NopDecoder) Zadd(key []byte, score float64, member []byte) {} 22 | func (d NopDecoder) EndZSet(key []byte) {} 23 | -------------------------------------------------------------------------------- /vendor/github.com/cupcake/rdb/slice_buffer.go: -------------------------------------------------------------------------------- 1 | package rdb 2 | 3 | import ( 4 | "errors" 5 | "io" 6 | ) 7 | 8 | type sliceBuffer struct { 9 | s []byte 10 | i int 11 | } 12 | 13 | func newSliceBuffer(s []byte) *sliceBuffer { 14 | return &sliceBuffer{s, 0} 15 | } 16 | 17 | func (s *sliceBuffer) Slice(n int) ([]byte, error) { 18 | if s.i+n > len(s.s) { 19 | return nil, io.EOF 20 | } 21 | b := s.s[s.i : s.i+n] 22 | s.i += n 23 | return b, nil 24 | } 25 | 26 | func (s *sliceBuffer) ReadByte() (byte, error) { 27 | if s.i >= len(s.s) { 28 | return 0, io.EOF 29 | } 30 | b := s.s[s.i] 31 | s.i++ 32 | return b, nil 33 | } 34 | 35 | func (s *sliceBuffer) Read(b []byte) (int, error) { 36 | if len(b) == 0 { 37 | return 0, nil 38 | } 39 | if s.i >= len(s.s) { 40 | return 0, io.EOF 41 | } 42 | n := copy(b, s.s[s.i:]) 43 | s.i += n 44 | return n, nil 45 | } 46 | 47 | func (s *sliceBuffer) Seek(offset int64, whence int) (int64, error) { 48 | var abs int64 49 | switch whence { 50 | case 0: 51 | abs = offset 52 | case 1: 53 | abs = int64(s.i) + offset 54 | case 2: 55 | abs = int64(len(s.s)) + offset 56 | default: 57 | return 0, errors.New("invalid whence") 58 | } 59 | if abs < 0 { 60 | return 0, errors.New("negative position") 61 | } 62 | if abs >= 1<<31 { 63 | return 0, errors.New("position out of range") 64 | } 65 | s.i = int(abs) 66 | return abs, nil 67 | } 68 | -------------------------------------------------------------------------------- /vendor/github.com/edsrzf/mmap-go/README.md: -------------------------------------------------------------------------------- 1 | mmap-go 2 | ======= 3 | 4 | mmap-go is a portable mmap package for the [Go programming language](http://golang.org). 5 | It has been tested on Linux (386, amd64), OS X, and Windows (386). It should also 6 | work on other Unix-like platforms, but hasn't been tested with them. I'm interested 7 | to hear about the results. 8 | 9 | I haven't been able to add more features without adding significant complexity, 10 | so mmap-go doesn't support mprotect, mincore, and maybe a few other things. 11 | If you're running on a Unix-like platform and need some of these features, 12 | I suggest Gustavo Niemeyer's [gommap](http://labix.org/gommap). 13 | -------------------------------------------------------------------------------- /vendor/github.com/go-macaron/cache/README.md: -------------------------------------------------------------------------------- 1 | # cache [![Build Status](https://travis-ci.org/go-macaron/cache.svg?branch=master)](https://travis-ci.org/go-macaron/cache) [![](http://gocover.io/_badge/github.com/go-macaron/cache)](http://gocover.io/github.com/go-macaron/cache) 2 | 3 | Middleware cache provides cache management for [Macaron](https://github.com/go-macaron/macaron). It can use many cache adapters, including memory, file, Redis, Memcache, PostgreSQL, MySQL, Ledis and Nodb. 4 | 5 | ### Installation 6 | 7 | go get github.com/go-macaron/cache 8 | 9 | ## Getting Help 10 | 11 | - [API Reference](https://gowalker.org/github.com/go-macaron/cache) 12 | - [Documentation](http://go-macaron.com/docs/middlewares/cache) 13 | 14 | ## Credits 15 | 16 | This package is a modified version of [beego/cache](https://github.com/astaxie/beego/tree/master/cache). 17 | 18 | ## License 19 | 20 | This project is under the Apache License, Version 2.0. See the [LICENSE](LICENSE) file for the full license text. -------------------------------------------------------------------------------- /vendor/github.com/go-macaron/cache/ledis/ledis.goconvey: -------------------------------------------------------------------------------- 1 | ignore -------------------------------------------------------------------------------- /vendor/github.com/go-macaron/captcha/README.md: -------------------------------------------------------------------------------- 1 | # captcha [![Build Status](https://travis-ci.org/go-macaron/captcha.svg?branch=master)](https://travis-ci.org/go-macaron/captcha) 2 | 3 | Middleware captcha provides captcha service for [Macaron](https://github.com/go-macaron/macaron). 4 | 5 | ### Installation 6 | 7 | go get github.com/go-macaron/captcha 8 | 9 | ## Getting Help 10 | 11 | - [API Reference](https://gowalker.org/github.com/go-macaron/captcha) 12 | - [Documentation](http://go-macaron.com/docs/middlewares/captcha) 13 | 14 | ## License 15 | 16 | This project is under the Apache License, Version 2.0. See the [LICENSE](LICENSE) file for the full license text. -------------------------------------------------------------------------------- /vendor/github.com/go-macaron/inject/README.md: -------------------------------------------------------------------------------- 1 | # inject [![Build Status](https://travis-ci.org/go-macaron/inject.svg?branch=master)](https://travis-ci.org/go-macaron/inject) [![](http://gocover.io/_badge/github.com/go-macaron/inject)](http://gocover.io/github.com/go-macaron/inject) 2 | 3 | Package inject provides utilities for mapping and injecting dependencies in various ways. 4 | 5 | **This a modified version of [codegangsta/inject](https://github.com/codegangsta/inject) for special purpose of Macaron** 6 | 7 | **Please use the original version if you need dependency injection feature** 8 | 9 | ## License 10 | 11 | This project is under the Apache License, Version 2.0. See the [LICENSE](LICENSE) file for the full license text. -------------------------------------------------------------------------------- /vendor/github.com/go-macaron/session/README.md: -------------------------------------------------------------------------------- 1 | # session [![Build Status](https://travis-ci.org/go-macaron/session.svg?branch=master)](https://travis-ci.org/go-macaron/session) [![](http://gocover.io/_badge/github.com/go-macaron/session)](http://gocover.io/github.com/go-macaron/session) 2 | 3 | Middleware session provides session management for [Macaron](https://github.com/go-macaron/macaron). It can use many session providers, including memory, file, Redis, Memcache, PostgreSQL, MySQL, Couchbase, Ledis and Nodb. 4 | 5 | ### Installation 6 | 7 | go get github.com/go-macaron/session 8 | 9 | ## Getting Help 10 | 11 | - [API Reference](https://gowalker.org/github.com/go-macaron/session) 12 | - [Documentation](http://go-macaron.com/docs/middlewares/session) 13 | 14 | ## Credits 15 | 16 | This package is a modified version of [beego/session](https://github.com/astaxie/beego/tree/master/session). 17 | 18 | ## License 19 | 20 | This project is under the Apache License, Version 2.0. See the [LICENSE](LICENSE) file for the full license text. -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/builder/builder_delete.go: -------------------------------------------------------------------------------- 1 | package builder 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | ) 7 | 8 | func (b *Builder) deleteToSQL() (string, []interface{}, error) { 9 | if len(b.tableName) <= 0 { 10 | return "", nil, errors.New("no table indicated") 11 | } 12 | 13 | w := NewWriter() 14 | if _, err := fmt.Fprintf(w, "DELETE FROM %s WHERE ", b.tableName); err != nil { 15 | return "", nil, err 16 | } 17 | 18 | err := b.cond.WriteTo(w) 19 | if err != nil { 20 | return "", nil, err 21 | } 22 | 23 | return w.writer.String(), w.args, nil 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/builder/builder_select.go: -------------------------------------------------------------------------------- 1 | package builder 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | ) 7 | 8 | func (b *Builder) selectToSQL() (string, []interface{}, error) { 9 | if len(b.tableName) <= 0 { 10 | return "", nil, errors.New("no table indicated") 11 | } 12 | 13 | w := NewWriter() 14 | if _, err := fmt.Fprint(w, "SELECT "); err != nil { 15 | return "", nil, err 16 | } 17 | if len(b.selects) > 0 { 18 | for i, s := range b.selects { 19 | if _, err := fmt.Fprint(w, s); err != nil { 20 | return "", nil, err 21 | } 22 | if i != len(b.selects)-1 { 23 | if _, err := fmt.Fprint(w, ","); err != nil { 24 | return "", nil, err 25 | } 26 | } 27 | } 28 | } else { 29 | if _, err := fmt.Fprint(w, "*"); err != nil { 30 | return "", nil, err 31 | } 32 | } 33 | 34 | if _, err := fmt.Fprintf(w, " FROM %s", b.tableName); err != nil { 35 | return "", nil, err 36 | } 37 | 38 | for _, v := range b.joins { 39 | fmt.Fprintf(w, " %s JOIN %s ON ", v.joinType, v.joinTable) 40 | if err := v.joinCond.WriteTo(w); err != nil { 41 | return "", nil, err 42 | } 43 | } 44 | 45 | if _, err := fmt.Fprint(w, " WHERE "); err != nil { 46 | return "", nil, err 47 | } 48 | 49 | err := b.cond.WriteTo(w) 50 | if err != nil { 51 | return "", nil, err 52 | } 53 | 54 | return w.writer.String(), w.args, nil 55 | } 56 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/builder/builder_update.go: -------------------------------------------------------------------------------- 1 | package builder 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | ) 7 | 8 | func (b *Builder) updateToSQL() (string, []interface{}, error) { 9 | if len(b.tableName) <= 0 { 10 | return "", nil, errors.New("no table indicated") 11 | } 12 | if len(b.updates) <= 0 { 13 | return "", nil, errors.New("no column to be update") 14 | } 15 | 16 | w := NewWriter() 17 | if _, err := fmt.Fprintf(w, "UPDATE %s SET ", b.tableName); err != nil { 18 | return "", nil, err 19 | } 20 | 21 | for i, s := range b.updates { 22 | if err := s.WriteTo(w); err != nil { 23 | return "", nil, err 24 | } 25 | 26 | if i != len(b.updates)-1 { 27 | if _, err := fmt.Fprint(w, ","); err != nil { 28 | return "", nil, err 29 | } 30 | } 31 | } 32 | 33 | if _, err := fmt.Fprint(w, " WHERE "); err != nil { 34 | return "", nil, err 35 | } 36 | 37 | err := b.cond.WriteTo(w) 38 | if err != nil { 39 | return "", nil, err 40 | } 41 | 42 | return w.writer.String(), w.args, nil 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/builder/cond_and.go: -------------------------------------------------------------------------------- 1 | package builder 2 | 3 | import "fmt" 4 | 5 | type condAnd []Cond 6 | 7 | var _ Cond = condAnd{} 8 | 9 | func And(conds ...Cond) Cond { 10 | var result = make(condAnd, 0, len(conds)) 11 | for _, cond := range conds { 12 | if cond == nil || !cond.IsValid() { 13 | continue 14 | } 15 | result = append(result, cond) 16 | } 17 | return result 18 | } 19 | 20 | func (and condAnd) WriteTo(w Writer) error { 21 | for i, cond := range and { 22 | if _, ok := cond.(condOr); ok { 23 | fmt.Fprint(w, "(") 24 | } 25 | 26 | err := cond.WriteTo(w) 27 | if err != nil { 28 | return err 29 | } 30 | 31 | if _, ok := cond.(condOr); ok { 32 | fmt.Fprint(w, ")") 33 | } 34 | 35 | if i != len(and)-1 { 36 | fmt.Fprint(w, " AND ") 37 | } 38 | } 39 | 40 | return nil 41 | } 42 | 43 | func (and condAnd) And(conds ...Cond) Cond { 44 | return And(and, And(conds...)) 45 | } 46 | 47 | func (and condAnd) Or(conds ...Cond) Cond { 48 | return Or(and, Or(conds...)) 49 | } 50 | 51 | func (and condAnd) IsValid() bool { 52 | return len(and) > 0 53 | } 54 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/builder/cond_between.go: -------------------------------------------------------------------------------- 1 | package builder 2 | 3 | import "fmt" 4 | 5 | // Between 6 | type Between struct { 7 | col string 8 | lessVal interface{} 9 | moreVal interface{} 10 | } 11 | 12 | var _ Cond = Between{} 13 | 14 | func (between Between) WriteTo(w Writer) error { 15 | if _, err := fmt.Fprintf(w, "%s BETWEEN ? AND ?", between.col); err != nil { 16 | return err 17 | } 18 | w.Append(between.lessVal, between.moreVal) 19 | return nil 20 | } 21 | 22 | func (between Between) And(conds ...Cond) Cond { 23 | return And(between, And(conds...)) 24 | } 25 | 26 | func (between Between) Or(conds ...Cond) Cond { 27 | return Or(between, Or(conds...)) 28 | } 29 | 30 | func (between Between) IsValid() bool { 31 | return len(between.col) > 0 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/builder/cond_eq.go: -------------------------------------------------------------------------------- 1 | package builder 2 | 3 | import "fmt" 4 | 5 | type Eq map[string]interface{} 6 | 7 | var _ Cond = Eq{} 8 | 9 | func (eq Eq) WriteTo(w Writer) error { 10 | var args = make([]interface{}, 0, len(eq)) 11 | var i = 0 12 | for k, v := range eq { 13 | switch v.(type) { 14 | case []int, []int64, []string, []int32, []int16, []int8: 15 | if err := In(k, v).WriteTo(w); err != nil { 16 | return err 17 | } 18 | case expr: 19 | if _, err := fmt.Fprintf(w, "%s=(", k); err != nil { 20 | return err 21 | } 22 | 23 | if err := v.(expr).WriteTo(w); err != nil { 24 | return err 25 | } 26 | 27 | if _, err := fmt.Fprintf(w, ")"); err != nil { 28 | return err 29 | } 30 | 31 | default: 32 | if _, err := fmt.Fprintf(w, "%s=?", k); err != nil { 33 | return err 34 | } 35 | args = append(args, v) 36 | } 37 | if i != len(eq)-1 { 38 | if _, err := fmt.Fprint(w, " AND "); err != nil { 39 | return err 40 | } 41 | } 42 | i = i + 1 43 | } 44 | w.Append(args...) 45 | return nil 46 | } 47 | 48 | func (eq Eq) And(conds ...Cond) Cond { 49 | return And(eq, And(conds...)) 50 | } 51 | 52 | func (eq Eq) Or(conds ...Cond) Cond { 53 | return Or(eq, Or(conds...)) 54 | } 55 | 56 | func (eq Eq) IsValid() bool { 57 | return len(eq) > 0 58 | } 59 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/builder/cond_expr.go: -------------------------------------------------------------------------------- 1 | package builder 2 | 3 | import "fmt" 4 | 5 | type expr struct { 6 | sql string 7 | args []interface{} 8 | } 9 | 10 | var _ Cond = expr{} 11 | 12 | func Expr(sql string, args ...interface{}) Cond { 13 | return expr{sql, args} 14 | } 15 | 16 | func (expr expr) WriteTo(w Writer) error { 17 | if _, err := fmt.Fprint(w, expr.sql); err != nil { 18 | return err 19 | } 20 | w.Append(expr.args...) 21 | return nil 22 | } 23 | 24 | func (expr expr) And(conds ...Cond) Cond { 25 | return And(expr, And(conds...)) 26 | } 27 | 28 | func (expr expr) Or(conds ...Cond) Cond { 29 | return Or(expr, Or(conds...)) 30 | } 31 | 32 | func (expr expr) IsValid() bool { 33 | return len(expr.sql) > 0 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/builder/cond_like.go: -------------------------------------------------------------------------------- 1 | package builder 2 | 3 | import "fmt" 4 | 5 | type Like [2]string 6 | 7 | var _ Cond = Like{"", ""} 8 | 9 | func (like Like) WriteTo(w Writer) error { 10 | if _, err := fmt.Fprintf(w, "%s LIKE ?", like[0]); err != nil { 11 | return err 12 | } 13 | w.Append("%" + like[1] + "%") 14 | return nil 15 | } 16 | 17 | func (like Like) And(conds ...Cond) Cond { 18 | return And(like, And(conds...)) 19 | } 20 | 21 | func (like Like) Or(conds ...Cond) Cond { 22 | return Or(like, Or(conds...)) 23 | } 24 | 25 | func (like Like) IsValid() bool { 26 | return len(like[0]) > 0 && len(like[1]) > 0 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/builder/cond_neq.go: -------------------------------------------------------------------------------- 1 | package builder 2 | 3 | import "fmt" 4 | 5 | type Neq map[string]interface{} 6 | 7 | var _ Cond = Neq{} 8 | 9 | func (neq Neq) WriteTo(w Writer) error { 10 | var args = make([]interface{}, 0, len(neq)) 11 | var i = 0 12 | for k, v := range neq { 13 | switch v.(type) { 14 | case []int, []int64, []string, []int32, []int16, []int8: 15 | if err := NotIn(k, v).WriteTo(w); err != nil { 16 | return err 17 | } 18 | case expr: 19 | if _, err := fmt.Fprintf(w, "%s<>(", k); err != nil { 20 | return err 21 | } 22 | 23 | if err := v.(expr).WriteTo(w); err != nil { 24 | return err 25 | } 26 | 27 | if _, err := fmt.Fprintf(w, ")"); err != nil { 28 | return err 29 | } 30 | default: 31 | if _, err := fmt.Fprintf(w, "%s<>?", k); err != nil { 32 | return err 33 | } 34 | args = append(args, v) 35 | } 36 | if i != len(neq)-1 { 37 | if _, err := fmt.Fprint(w, " AND "); err != nil { 38 | return err 39 | } 40 | } 41 | i = i + 1 42 | } 43 | w.Append(args...) 44 | return nil 45 | } 46 | 47 | func (neq Neq) And(conds ...Cond) Cond { 48 | return And(neq, And(conds...)) 49 | } 50 | 51 | func (neq Neq) Or(conds ...Cond) Cond { 52 | return Or(neq, Or(conds...)) 53 | } 54 | 55 | func (neq Neq) IsValid() bool { 56 | return len(neq) > 0 57 | } 58 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/builder/cond_not.go: -------------------------------------------------------------------------------- 1 | package builder 2 | 3 | import "fmt" 4 | 5 | type Not [1]Cond 6 | 7 | var _ Cond = Not{} 8 | 9 | func (not Not) WriteTo(w Writer) error { 10 | if _, err := fmt.Fprint(w, "NOT "); err != nil { 11 | return err 12 | } 13 | switch not[0].(type) { 14 | case condAnd, condOr: 15 | if _, err := fmt.Fprint(w, "("); err != nil { 16 | return err 17 | } 18 | } 19 | 20 | if err := not[0].WriteTo(w); err != nil { 21 | return err 22 | } 23 | 24 | switch not[0].(type) { 25 | case condAnd, condOr: 26 | if _, err := fmt.Fprint(w, ")"); err != nil { 27 | return err 28 | } 29 | } 30 | 31 | return nil 32 | } 33 | 34 | func (not Not) And(conds ...Cond) Cond { 35 | return And(not, And(conds...)) 36 | } 37 | 38 | func (not Not) Or(conds ...Cond) Cond { 39 | return Or(not, Or(conds...)) 40 | } 41 | 42 | func (not Not) IsValid() bool { 43 | return not[0] != nil && not[0].IsValid() 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/builder/cond_null.go: -------------------------------------------------------------------------------- 1 | package builder 2 | 3 | import "fmt" 4 | 5 | // IsNull 6 | type IsNull [1]string 7 | 8 | var _ Cond = IsNull{""} 9 | 10 | func (isNull IsNull) WriteTo(w Writer) error { 11 | _, err := fmt.Fprintf(w, "%s IS NULL", isNull[0]) 12 | return err 13 | } 14 | 15 | func (isNull IsNull) And(conds ...Cond) Cond { 16 | return And(isNull, And(conds...)) 17 | } 18 | 19 | func (isNull IsNull) Or(conds ...Cond) Cond { 20 | return Or(isNull, Or(conds...)) 21 | } 22 | 23 | func (isNull IsNull) IsValid() bool { 24 | return len(isNull[0]) > 0 25 | } 26 | 27 | // NotNull 28 | type NotNull [1]string 29 | 30 | var _ Cond = NotNull{""} 31 | 32 | func (notNull NotNull) WriteTo(w Writer) error { 33 | _, err := fmt.Fprintf(w, "%s IS NOT NULL", notNull[0]) 34 | return err 35 | } 36 | 37 | func (notNull NotNull) And(conds ...Cond) Cond { 38 | return And(notNull, And(conds...)) 39 | } 40 | 41 | func (notNull NotNull) Or(conds ...Cond) Cond { 42 | return Or(notNull, Or(conds...)) 43 | } 44 | 45 | func (notNull NotNull) IsValid() bool { 46 | return len(notNull[0]) > 0 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/builder/cond_or.go: -------------------------------------------------------------------------------- 1 | package builder 2 | 3 | import "fmt" 4 | 5 | type condOr []Cond 6 | 7 | var _ Cond = condOr{} 8 | 9 | func Or(conds ...Cond) Cond { 10 | var result = make(condOr, 0, len(conds)) 11 | for _, cond := range conds { 12 | if cond == nil || !cond.IsValid() { 13 | continue 14 | } 15 | result = append(result, cond) 16 | } 17 | return result 18 | } 19 | 20 | func (or condOr) WriteTo(w Writer) error { 21 | for i, cond := range or { 22 | if _, ok := cond.(condAnd); ok { 23 | fmt.Fprint(w, "(") 24 | } 25 | 26 | err := cond.WriteTo(w) 27 | if err != nil { 28 | return err 29 | } 30 | 31 | if _, ok := cond.(condAnd); ok { 32 | fmt.Fprint(w, ")") 33 | } 34 | 35 | if i != len(or)-1 { 36 | fmt.Fprint(w, " OR ") 37 | } 38 | } 39 | 40 | return nil 41 | } 42 | 43 | func (o condOr) And(conds ...Cond) Cond { 44 | return And(o, And(conds...)) 45 | } 46 | 47 | func (o condOr) Or(conds ...Cond) Cond { 48 | return Or(o, Or(conds...)) 49 | } 50 | 51 | func (o condOr) IsValid() bool { 52 | return len(o) > 0 53 | } 54 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/builder/error.go: -------------------------------------------------------------------------------- 1 | package builder 2 | 3 | import "errors" 4 | 5 | var ( 6 | ErrNotSupportType = errors.New("not supported SQL type") 7 | ) 8 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/builder/set.go: -------------------------------------------------------------------------------- 1 | package builder 2 | 3 | type Set interface { 4 | Cond 5 | IsSet() bool 6 | } 7 | 8 | var ( 9 | _ Set = Eq{} 10 | _ Set = expr{} 11 | ) 12 | 13 | func (eq Eq) IsSet() bool { 14 | return true 15 | } 16 | 17 | func (expr expr) IsSet() bool { 18 | return true 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/core/benchmark.sh: -------------------------------------------------------------------------------- 1 | go test -v -bench=. -run=XXX 2 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/core/converstion.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | // Conversion is an interface. A type implements Conversion will according 4 | // the custom method to fill into database and retrieve from database. 5 | type Conversion interface { 6 | FromDB([]byte) error 7 | ToDB() ([]byte, error) 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/core/driver.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | type Driver interface { 4 | Parse(string, string) (*Uri, error) 5 | } 6 | 7 | var ( 8 | drivers = map[string]Driver{} 9 | ) 10 | 11 | func RegisterDriver(driverName string, driver Driver) { 12 | if driver == nil { 13 | panic("core: Register driver is nil") 14 | } 15 | if _, dup := drivers[driverName]; dup { 16 | panic("core: Register called twice for driver " + driverName) 17 | } 18 | drivers[driverName] = driver 19 | } 20 | 21 | func QueryDriver(driverName string) Driver { 22 | return drivers[driverName] 23 | } 24 | 25 | func RegisteredDriverSize() int { 26 | return len(drivers) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/core/error.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | import "errors" 4 | 5 | var ( 6 | ErrNoMapPointer = errors.New("mp should be a map's pointer") 7 | ErrNoStructPointer = errors.New("mp should be a struct's pointer") 8 | ) 9 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/core/ilogger.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | type LogLevel int 4 | 5 | const ( 6 | // !nashtsai! following level also match syslog.Priority value 7 | LOG_DEBUG LogLevel = iota 8 | LOG_INFO 9 | LOG_WARNING 10 | LOG_ERR 11 | LOG_OFF 12 | LOG_UNKNOWN 13 | ) 14 | 15 | // logger interface 16 | type ILogger interface { 17 | Debug(v ...interface{}) 18 | Debugf(format string, v ...interface{}) 19 | Error(v ...interface{}) 20 | Errorf(format string, v ...interface{}) 21 | Info(v ...interface{}) 22 | Infof(format string, v ...interface{}) 23 | Warn(v ...interface{}) 24 | Warnf(format string, v ...interface{}) 25 | 26 | Level() LogLevel 27 | SetLevel(l LogLevel) 28 | 29 | ShowSQL(show ...bool) 30 | IsShowSQL() bool 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/core/index.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | import ( 4 | "fmt" 5 | "sort" 6 | "strings" 7 | ) 8 | 9 | const ( 10 | IndexType = iota + 1 11 | UniqueType 12 | ) 13 | 14 | // database index 15 | type Index struct { 16 | IsRegular bool 17 | Name string 18 | Type int 19 | Cols []string 20 | } 21 | 22 | func (index *Index) XName(tableName string) string { 23 | if !strings.HasPrefix(index.Name, "UQE_") && 24 | !strings.HasPrefix(index.Name, "IDX_") { 25 | if index.Type == UniqueType { 26 | return fmt.Sprintf("UQE_%v_%v", tableName, index.Name) 27 | } 28 | return fmt.Sprintf("IDX_%v_%v", tableName, index.Name) 29 | } 30 | return index.Name 31 | } 32 | 33 | // add columns which will be composite index 34 | func (index *Index) AddColumn(cols ...string) { 35 | for _, col := range cols { 36 | index.Cols = append(index.Cols, col) 37 | } 38 | } 39 | 40 | func (index *Index) Equal(dst *Index) bool { 41 | if index.Type != dst.Type { 42 | return false 43 | } 44 | if len(index.Cols) != len(dst.Cols) { 45 | return false 46 | } 47 | sort.StringSlice(index.Cols).Sort() 48 | sort.StringSlice(dst.Cols).Sort() 49 | 50 | for i := 0; i < len(index.Cols); i++ { 51 | if index.Cols[i] != dst.Cols[i] { 52 | return false 53 | } 54 | } 55 | return true 56 | } 57 | 58 | // new an index 59 | func NewIndex(name string, indexType int) *Index { 60 | return &Index{true, name, indexType, make([]string, 0)} 61 | } 62 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/core/pk.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | import ( 4 | "bytes" 5 | "encoding/gob" 6 | ) 7 | 8 | type PK []interface{} 9 | 10 | func NewPK(pks ...interface{}) *PK { 11 | p := PK(pks) 12 | return &p 13 | } 14 | 15 | func (p *PK) ToString() (string, error) { 16 | buf := new(bytes.Buffer) 17 | enc := gob.NewEncoder(buf) 18 | err := enc.Encode(*p) 19 | return buf.String(), err 20 | } 21 | 22 | func (p *PK) FromString(content string) error { 23 | dec := gob.NewDecoder(bytes.NewBufferString(content)) 24 | err := dec.Decode(p) 25 | return err 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/core/scan.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | import ( 4 | "database/sql/driver" 5 | "fmt" 6 | "time" 7 | ) 8 | 9 | type NullTime time.Time 10 | 11 | var ( 12 | _ driver.Valuer = NullTime{} 13 | ) 14 | 15 | func (ns *NullTime) Scan(value interface{}) error { 16 | if value == nil { 17 | return nil 18 | } 19 | return convertTime(ns, value) 20 | } 21 | 22 | // Value implements the driver Valuer interface. 23 | func (ns NullTime) Value() (driver.Value, error) { 24 | if (time.Time)(ns).IsZero() { 25 | return nil, nil 26 | } 27 | return (time.Time)(ns).Format("2006-01-02 15:04:05"), nil 28 | } 29 | 30 | func convertTime(dest *NullTime, src interface{}) error { 31 | // Common cases, without reflect. 32 | switch s := src.(type) { 33 | case string: 34 | t, err := time.Parse("2006-01-02 15:04:05", s) 35 | if err != nil { 36 | return err 37 | } 38 | *dest = NullTime(t) 39 | return nil 40 | case []uint8: 41 | t, err := time.Parse("2006-01-02 15:04:05", string(s)) 42 | if err != nil { 43 | return err 44 | } 45 | *dest = NullTime(t) 46 | return nil 47 | case nil: 48 | default: 49 | return fmt.Errorf("unsupported driver -> Scan pair: %T -> %T", src, dest) 50 | } 51 | return nil 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/VERSION: -------------------------------------------------------------------------------- 1 | xorm v0.6.0.0923 -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/error.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Xorm Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package xorm 6 | 7 | import ( 8 | "errors" 9 | ) 10 | 11 | var ( 12 | ErrParamsType error = errors.New("Params type error") 13 | ErrTableNotFound error = errors.New("Not found table") 14 | ErrUnSupportedType error = errors.New("Unsupported type error") 15 | ErrNotExist error = errors.New("Not exist error") 16 | ErrCacheFailed error = errors.New("Cache failed") 17 | ErrNeedDeletedCond error = errors.New("Delete need at least one condition") 18 | ErrNotImplemented error = errors.New("Not implemented.") 19 | ) 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/gen_reserved.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if [ -f $1 ];then 3 | cat $1| awk '{printf("\""$1"\":true,\n")}' 4 | else 5 | echo "argument $1 if not a file!" 6 | fi 7 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/goracle_driver.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Xorm Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package xorm 6 | 7 | import ( 8 | "errors" 9 | "regexp" 10 | 11 | "github.com/go-xorm/core" 12 | ) 13 | 14 | // func init() { 15 | // core.RegisterDriver("goracle", &goracleDriver{}) 16 | // } 17 | 18 | type goracleDriver struct { 19 | } 20 | 21 | func (cfg *goracleDriver) Parse(driverName, dataSourceName string) (*core.Uri, error) { 22 | db := &core.Uri{DbType: core.ORACLE} 23 | dsnPattern := regexp.MustCompile( 24 | `^(?:(?P.*?)(?::(?P.*))?@)?` + // [user[:password]@] 25 | `(?:(?P[^\(]*)(?:\((?P[^\)]*)\))?)?` + // [net[(addr)]] 26 | `\/(?P.*?)` + // /dbname 27 | `(?:\?(?P[^\?]*))?$`) // [?param1=value1¶mN=valueN] 28 | matches := dsnPattern.FindStringSubmatch(dataSourceName) 29 | //tlsConfigRegister := make(map[string]*tls.Config) 30 | names := dsnPattern.SubexpNames() 31 | 32 | for i, match := range matches { 33 | switch names[i] { 34 | case "dbname": 35 | db.DbName = match 36 | } 37 | } 38 | if db.DbName == "" { 39 | return nil, errors.New("dbname is empty") 40 | } 41 | return db, nil 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/memory_store.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Xorm Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package xorm 6 | 7 | import ( 8 | "sync" 9 | 10 | "github.com/go-xorm/core" 11 | ) 12 | 13 | var _ core.CacheStore = NewMemoryStore() 14 | 15 | // memory store 16 | type MemoryStore struct { 17 | store map[interface{}]interface{} 18 | mutex sync.RWMutex 19 | } 20 | 21 | func NewMemoryStore() *MemoryStore { 22 | return &MemoryStore{store: make(map[interface{}]interface{})} 23 | } 24 | 25 | func (s *MemoryStore) Put(key string, value interface{}) error { 26 | s.mutex.Lock() 27 | defer s.mutex.Unlock() 28 | s.store[key] = value 29 | return nil 30 | } 31 | 32 | func (s *MemoryStore) Get(key string) (interface{}, error) { 33 | s.mutex.RLock() 34 | defer s.mutex.RUnlock() 35 | if v, ok := s.store[key]; ok { 36 | return v, nil 37 | } 38 | 39 | return nil, ErrNotExist 40 | } 41 | 42 | func (s *MemoryStore) Del(key string) error { 43 | s.mutex.Lock() 44 | defer s.mutex.Unlock() 45 | delete(s.store, key) 46 | return nil 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/mysql_driver.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Xorm Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package xorm 6 | 7 | import ( 8 | "regexp" 9 | "strings" 10 | 11 | "github.com/go-xorm/core" 12 | ) 13 | 14 | type mysqlDriver struct { 15 | } 16 | 17 | func (p *mysqlDriver) Parse(driverName, dataSourceName string) (*core.Uri, error) { 18 | dsnPattern := regexp.MustCompile( 19 | `^(?:(?P.*?)(?::(?P.*))?@)?` + // [user[:password]@] 20 | `(?:(?P[^\(]*)(?:\((?P[^\)]*)\))?)?` + // [net[(addr)]] 21 | `\/(?P.*?)` + // /dbname 22 | `(?:\?(?P[^\?]*))?$`) // [?param1=value1¶mN=valueN] 23 | matches := dsnPattern.FindStringSubmatch(dataSourceName) 24 | //tlsConfigRegister := make(map[string]*tls.Config) 25 | names := dsnPattern.SubexpNames() 26 | 27 | uri := &core.Uri{DbType: core.MYSQL} 28 | 29 | for i, match := range matches { 30 | switch names[i] { 31 | case "dbname": 32 | uri.DbName = match 33 | case "params": 34 | if len(match) > 0 { 35 | kvs := strings.Split(match, "&") 36 | for _, kv := range kvs { 37 | splits := strings.Split(kv, "=") 38 | if len(splits) == 2 { 39 | switch splits[0] { 40 | case "charset": 41 | uri.Charset = splits[1] 42 | } 43 | } 44 | } 45 | } 46 | 47 | } 48 | } 49 | return uri, nil 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/oci8_driver.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Xorm Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package xorm 6 | 7 | import ( 8 | "errors" 9 | "regexp" 10 | 11 | "github.com/go-xorm/core" 12 | ) 13 | 14 | type oci8Driver struct { 15 | } 16 | 17 | //dataSourceName=user/password@ipv4:port/dbname 18 | //dataSourceName=user/password@[ipv6]:port/dbname 19 | func (p *oci8Driver) Parse(driverName, dataSourceName string) (*core.Uri, error) { 20 | db := &core.Uri{DbType: core.ORACLE} 21 | dsnPattern := regexp.MustCompile( 22 | `^(?P.*)\/(?P.*)@` + // user:password@ 23 | `(?P.*)` + // ip:port 24 | `\/(?P.*)`) // dbname 25 | matches := dsnPattern.FindStringSubmatch(dataSourceName) 26 | names := dsnPattern.SubexpNames() 27 | for i, match := range matches { 28 | switch names[i] { 29 | case "dbname": 30 | db.DbName = match 31 | } 32 | } 33 | if db.DbName == "" { 34 | return nil, errors.New("dbname is empty") 35 | } 36 | return db, nil 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/odbc_driver.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Xorm Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package xorm 6 | 7 | import ( 8 | "errors" 9 | "strings" 10 | 11 | "github.com/go-xorm/core" 12 | ) 13 | 14 | type odbcDriver struct { 15 | } 16 | 17 | func (p *odbcDriver) Parse(driverName, dataSourceName string) (*core.Uri, error) { 18 | kv := strings.Split(dataSourceName, ";") 19 | var dbName string 20 | 21 | for _, c := range kv { 22 | vv := strings.Split(strings.TrimSpace(c), "=") 23 | if len(vv) == 2 { 24 | switch strings.ToLower(vv[0]) { 25 | case "database": 26 | dbName = vv[1] 27 | } 28 | } 29 | } 30 | if dbName == "" { 31 | return nil, errors.New("no db name provided") 32 | } 33 | return &core.Uri{DbName: dbName, DbType: core.MSSQL}, nil 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/processors.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Xorm Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package xorm 6 | 7 | // Executed before an object is initially persisted to the database 8 | type BeforeInsertProcessor interface { 9 | BeforeInsert() 10 | } 11 | 12 | // Executed before an object is updated 13 | type BeforeUpdateProcessor interface { 14 | BeforeUpdate() 15 | } 16 | 17 | // Executed before an object is deleted 18 | type BeforeDeleteProcessor interface { 19 | BeforeDelete() 20 | } 21 | 22 | type BeforeSetProcessor interface { 23 | BeforeSet(string, Cell) 24 | } 25 | 26 | type AfterSetProcessor interface { 27 | AfterSet(string, Cell) 28 | } 29 | 30 | // !nashtsai! TODO enable BeforeValidateProcessor when xorm start to support validations 31 | //// Executed before an object is validated 32 | //type BeforeValidateProcessor interface { 33 | // BeforeValidate() 34 | //} 35 | // -- 36 | 37 | // Executed after an object is persisted to the database 38 | type AfterInsertProcessor interface { 39 | AfterInsert() 40 | } 41 | 42 | // Executed after an object has been updated 43 | type AfterUpdateProcessor interface { 44 | AfterUpdate() 45 | } 46 | 47 | // Executed after an object has been deleted 48 | type AfterDeleteProcessor interface { 49 | AfterDelete() 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/sqlite3_driver.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Xorm Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package xorm 6 | 7 | import ( 8 | "github.com/go-xorm/core" 9 | ) 10 | 11 | // func init() { 12 | // core.RegisterDriver("sqlite3", &sqlite3Driver{}) 13 | // } 14 | 15 | type sqlite3Driver struct { 16 | } 17 | 18 | func (p *sqlite3Driver) Parse(driverName, dataSourceName string) (*core.Uri, error) { 19 | return &core.Uri{DbType: core.SQLITE, DbName: dataSourceName}, nil 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/types.go: -------------------------------------------------------------------------------- 1 | package xorm 2 | 3 | import ( 4 | "reflect" 5 | 6 | "github.com/go-xorm/core" 7 | ) 8 | 9 | var ( 10 | ptrPkType = reflect.TypeOf(&core.PK{}) 11 | pkType = reflect.TypeOf(core.PK{}) 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of Snappy-Go authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS files. 3 | # See the latter for an explanation. 4 | 5 | # Names should be added to this file as 6 | # Name or Organization 7 | # The email address is not required for organizations. 8 | 9 | # Please keep the list sorted. 10 | 11 | Damian Gryski 12 | Google Inc. 13 | Jan Mercl <0xjnml@gmail.com> 14 | Rodolfo Carvalho 15 | Sebastien Binet 16 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/README: -------------------------------------------------------------------------------- 1 | The Snappy compression format in the Go programming language. 2 | 3 | To download and install from source: 4 | $ go get github.com/golang/snappy 5 | 6 | Unless otherwise noted, the Snappy-Go source files are distributed 7 | under the BSD-style license found in the LICENSE file. 8 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/decode_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Snappy-Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !appengine 6 | // +build gc 7 | // +build !noasm 8 | 9 | package snappy 10 | 11 | // decode has the same semantics as in decode_other.go. 12 | // 13 | //go:noescape 14 | func decode(dst, src []byte) int 15 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/encode_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Snappy-Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !appengine 6 | // +build gc 7 | // +build !noasm 8 | 9 | package snappy 10 | 11 | // emitLiteral has the same semantics as in encode_other.go. 12 | // 13 | //go:noescape 14 | func emitLiteral(dst, lit []byte) int 15 | 16 | // emitCopy has the same semantics as in encode_other.go. 17 | // 18 | //go:noescape 19 | func emitCopy(dst []byte, offset, length int) int 20 | 21 | // extendMatch has the same semantics as in encode_other.go. 22 | // 23 | //go:noescape 24 | func extendMatch(src []byte, i, j int) int 25 | 26 | // encodeBlock has the same semantics as in encode_other.go. 27 | // 28 | //go:noescape 29 | func encodeBlock(dst, src []byte) (d int) -------------------------------------------------------------------------------- /vendor/github.com/guregu/null/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, Greg Roseberry 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | 8 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | 10 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /vendor/github.com/jmoiron/sqlx/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, Jason Moiron 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | -------------------------------------------------------------------------------- /vendor/github.com/jmoiron/sqlx/doc.go: -------------------------------------------------------------------------------- 1 | // Package sqlx provides general purpose extensions to database/sql. 2 | // 3 | // It is intended to seamlessly wrap database/sql and provide convenience 4 | // methods which are useful in the development of database driven applications. 5 | // None of the underlying database/sql methods are changed. Instead all extended 6 | // behavior is implemented through new methods defined on wrapper types. 7 | // 8 | // Additions include scanning into structs, named query support, rebinding 9 | // queries for different drivers, convenient shorthands for common error handling 10 | // and more. 11 | // 12 | package sqlx 13 | -------------------------------------------------------------------------------- /vendor/github.com/jmoiron/sqlx/reflectx/README.md: -------------------------------------------------------------------------------- 1 | # reflectx 2 | 3 | The sqlx package has special reflect needs. In particular, it needs to: 4 | 5 | * be able to map a name to a field 6 | * understand embedded structs 7 | * understand mapping names to fields by a particular tag 8 | * user specified name -> field mapping functions 9 | 10 | These behaviors mimic the behaviors by the standard library marshallers and also the 11 | behavior of standard Go accessors. 12 | 13 | The first two are amply taken care of by `Reflect.Value.FieldByName`, and the third is 14 | addressed by `Reflect.Value.FieldByNameFunc`, but these don't quite understand struct 15 | tags in the ways that are vital to most marshallers, and they are slow. 16 | 17 | This reflectx package extends reflect to achieve these goals. 18 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Yasuhiro Matsumoto 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 all 13 | 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 THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_fts5.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | // +build fts5 6 | 7 | package sqlite3 8 | 9 | /* 10 | #cgo CFLAGS: -DSQLITE_ENABLE_FTS5 11 | #cgo LDFLAGS: -lm 12 | */ 13 | import "C" 14 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_icu.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | // +build icu 6 | 7 | package sqlite3 8 | 9 | /* 10 | #cgo LDFLAGS: -licuuc -licui18n 11 | #cgo CFLAGS: -DSQLITE_ENABLE_ICU 12 | */ 13 | import "C" 14 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_json1.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | // +build json1 6 | 7 | package sqlite3 8 | 9 | /* 10 | #cgo CFLAGS: -DSQLITE_ENABLE_JSON1 11 | */ 12 | import "C" 13 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_libsqlite3.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | // +build libsqlite3 6 | 7 | package sqlite3 8 | 9 | /* 10 | #cgo CFLAGS: -DUSE_LIBSQLITE3 11 | #cgo linux LDFLAGS: -lsqlite3 12 | #cgo darwin LDFLAGS: -L/usr/local/opt/sqlite/lib -lsqlite3 13 | */ 14 | import "C" 15 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_omit_load_extension.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | // +build sqlite_omit_load_extension 6 | 7 | package sqlite3 8 | 9 | /* 10 | #cgo CFLAGS: -DSQLITE_OMIT_LOAD_EXTENSION 11 | */ 12 | import "C" 13 | import ( 14 | "errors" 15 | ) 16 | 17 | func (c *SQLiteConn) loadExtensions(extensions []string) error { 18 | return errors.New("Extensions have been disabled for static builds") 19 | } 20 | 21 | func (c *SQLiteConn) LoadExtension(lib string, entry string) error { 22 | return errors.New("Extensions have been disabled for static builds") 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_other.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | // +build !windows 6 | 7 | package sqlite3 8 | 9 | /* 10 | #cgo CFLAGS: -I. 11 | #cgo linux LDFLAGS: -ldl 12 | */ 13 | import "C" 14 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | // +build windows 6 | 7 | package sqlite3 8 | 9 | /* 10 | #cgo CFLAGS: -I. -fno-stack-check -fno-stack-protector -mno-stack-arg-probe 11 | #cgo windows,386 CFLAGS: -D_USE_32BIT_TIME_T 12 | #cgo LDFLAGS: -lmingwex -lmingw32 13 | */ 14 | import "C" 15 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/tracecallback_noimpl.go: -------------------------------------------------------------------------------- 1 | // +build !trace 2 | 3 | package sqlite3 4 | 5 | import "errors" 6 | 7 | func (c *SQLiteConn) RegisterAggregator(name string, impl interface{}, pure bool) error { 8 | return errors.New("This feature is not implemented") 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/go/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 siddontang 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | 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, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/go/filelock/file_lock_generic.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The LevelDB-Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows 6 | 7 | package filelock 8 | 9 | import ( 10 | "fmt" 11 | "io" 12 | "runtime" 13 | ) 14 | 15 | func Lock(name string) (io.Closer, error) { 16 | return nil, fmt.Errorf("leveldb/db: file locking is not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/go/filelock/file_lock_solaris.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The LevelDB-Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build solaris 6 | 7 | package filelock 8 | 9 | import ( 10 | "io" 11 | "os" 12 | "syscall" 13 | ) 14 | 15 | // lockCloser hides all of an os.File's methods, except for Close. 16 | type lockCloser struct { 17 | f *os.File 18 | } 19 | 20 | func (l lockCloser) Close() error { 21 | return l.f.Close() 22 | } 23 | 24 | func Lock(name string) (io.Closer, error) { 25 | f, err := os.Create(name) 26 | if err != nil { 27 | return nil, err 28 | } 29 | 30 | spec := syscall.Flock_t{ 31 | Type: syscall.F_WRLCK, 32 | Whence: int16(os.SEEK_SET), 33 | Start: 0, 34 | Len: 0, // 0 means to lock the entire file. 35 | Pid: int32(os.Getpid()), 36 | } 37 | if err := syscall.FcntlFlock(f.Fd(), syscall.F_SETLK, &spec); err != nil { 38 | f.Close() 39 | return nil, err 40 | } 41 | 42 | return lockCloser{f}, nil 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/go/filelock/file_lock_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The LevelDB-Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd 6 | 7 | package filelock 8 | 9 | import ( 10 | "io" 11 | "os" 12 | "syscall" 13 | ) 14 | 15 | // lockCloser hides all of an os.File's methods, except for Close. 16 | type lockCloser struct { 17 | f *os.File 18 | } 19 | 20 | func (l lockCloser) Close() error { 21 | return l.f.Close() 22 | } 23 | 24 | func Lock(name string) (io.Closer, error) { 25 | f, err := os.Create(name) 26 | if err != nil { 27 | return nil, err 28 | } 29 | 30 | /* 31 | Some people tell me FcntlFlock does not exist, so use flock here 32 | */ 33 | if err := syscall.Flock(int(f.Fd()), syscall.LOCK_EX|syscall.LOCK_NB); err != nil { 34 | f.Close() 35 | return nil, err 36 | } 37 | 38 | // spec := syscall.Flock_t{ 39 | // Type: syscall.F_WRLCK, 40 | // Whence: int16(os.SEEK_SET), 41 | // Start: 0, 42 | // Len: 0, // 0 means to lock the entire file. 43 | // Pid: int32(os.Getpid()), 44 | // } 45 | // if err := syscall.FcntlFlock(f.Fd(), syscall.F_SETLK, &spec); err != nil { 46 | // f.Close() 47 | // return nil, err 48 | // } 49 | 50 | return lockCloser{f}, nil 51 | } 52 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/go/filelock/file_lock_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The LevelDB-Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package filelock 6 | 7 | import ( 8 | "io" 9 | "syscall" 10 | ) 11 | 12 | // lockCloser hides all of an syscall.Handle's methods, except for Close. 13 | type lockCloser struct { 14 | fd syscall.Handle 15 | } 16 | 17 | func (l lockCloser) Close() error { 18 | return syscall.Close(l.fd) 19 | } 20 | 21 | func Lock(name string) (io.Closer, error) { 22 | p, err := syscall.UTF16PtrFromString(name) 23 | if err != nil { 24 | return nil, err 25 | } 26 | fd, err := syscall.CreateFile(p, 27 | syscall.GENERIC_READ|syscall.GENERIC_WRITE, 28 | 0, nil, syscall.CREATE_ALWAYS, 29 | syscall.FILE_ATTRIBUTE_NORMAL, 30 | 0, 31 | ) 32 | if err != nil { 33 | return nil, err 34 | } 35 | return lockCloser{fd: fd}, nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/go/hack/hack.go: -------------------------------------------------------------------------------- 1 | package hack 2 | 3 | import ( 4 | "reflect" 5 | "unsafe" 6 | ) 7 | 8 | // no copy to change slice to string 9 | // use your own risk 10 | func String(b []byte) (s string) { 11 | pbytes := (*reflect.SliceHeader)(unsafe.Pointer(&b)) 12 | pstring := (*reflect.StringHeader)(unsafe.Pointer(&s)) 13 | pstring.Data = pbytes.Data 14 | pstring.Len = pbytes.Len 15 | return 16 | } 17 | 18 | // no copy to change string to slice 19 | // use your own risk 20 | func Slice(s string) (b []byte) { 21 | pbytes := (*reflect.SliceHeader)(unsafe.Pointer(&b)) 22 | pstring := (*reflect.StringHeader)(unsafe.Pointer(&s)) 23 | pbytes.Data = pstring.Data 24 | pbytes.Len = pstring.Len 25 | pbytes.Cap = pstring.Len 26 | return 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/go/ioutil2/ioutil.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ioutil2 6 | 7 | import ( 8 | "io" 9 | "io/ioutil" 10 | "os" 11 | "path" 12 | ) 13 | 14 | // Write file to temp and atomically move when everything else succeeds. 15 | func WriteFileAtomic(filename string, data []byte, perm os.FileMode) error { 16 | dir, name := path.Split(filename) 17 | f, err := ioutil.TempFile(dir, name) 18 | if err != nil { 19 | return err 20 | } 21 | n, err := f.Write(data) 22 | f.Close() 23 | if err == nil && n < len(data) { 24 | err = io.ErrShortWrite 25 | } else { 26 | err = os.Chmod(f.Name(), perm) 27 | } 28 | if err != nil { 29 | os.Remove(f.Name()) 30 | return err 31 | } 32 | return os.Rename(f.Name(), filename) 33 | } 34 | 35 | // Check file exists or not 36 | func FileExists(name string) bool { 37 | _, err := os.Stat(name) 38 | return !os.IsNotExist(err) 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/go/log/doc.go: -------------------------------------------------------------------------------- 1 | // log package supplies more advanced features than go orign log package. 2 | // 3 | // It supports log different level: trace, debug, info, warn, error, fatal. 4 | // 5 | // It also supports different log handlers which you can log to stdout, file, socket, etc... 6 | // 7 | // Use 8 | // 9 | // import "github.com/siddontang/go/log" 10 | // 11 | // //log with different level 12 | // log.Info("hello world") 13 | // log.Error("hello world") 14 | // 15 | // //create a logger with specified handler 16 | // h := NewStreamHandler(os.Stdout) 17 | // l := log.NewDefault(h) 18 | // l.Info("hello world") 19 | // l.Infof("%s %d", "hello", 123) 20 | // 21 | package log 22 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/go/log/handler.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | import ( 4 | "io" 5 | ) 6 | 7 | //Handler writes logs to somewhere 8 | type Handler interface { 9 | Write(p []byte) (n int, err error) 10 | Close() error 11 | } 12 | 13 | //StreamHandler writes logs to a specified io Writer, maybe stdout, stderr, etc... 14 | type StreamHandler struct { 15 | w io.Writer 16 | } 17 | 18 | func NewStreamHandler(w io.Writer) (*StreamHandler, error) { 19 | h := new(StreamHandler) 20 | 21 | h.w = w 22 | 23 | return h, nil 24 | } 25 | 26 | func (h *StreamHandler) Write(b []byte) (n int, err error) { 27 | return h.w.Write(b) 28 | } 29 | 30 | func (h *StreamHandler) Close() error { 31 | return nil 32 | } 33 | 34 | //NullHandler does nothing, it discards anything. 35 | type NullHandler struct { 36 | } 37 | 38 | func NewNullHandler() (*NullHandler, error) { 39 | return new(NullHandler), nil 40 | } 41 | 42 | func (h *NullHandler) Write(b []byte) (n int, err error) { 43 | return len(b), nil 44 | } 45 | 46 | func (h *NullHandler) Close() { 47 | 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/go/log/sockethandler.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | import ( 4 | "encoding/binary" 5 | "net" 6 | "time" 7 | ) 8 | 9 | //SocketHandler writes log to a connectionl. 10 | //Network protocol is simple: log length + log | log length + log. log length is uint32, bigendian. 11 | //you must implement your own log server, maybe you can use logd instead simply. 12 | type SocketHandler struct { 13 | c net.Conn 14 | protocol string 15 | addr string 16 | } 17 | 18 | func NewSocketHandler(protocol string, addr string) (*SocketHandler, error) { 19 | s := new(SocketHandler) 20 | 21 | s.protocol = protocol 22 | s.addr = addr 23 | 24 | return s, nil 25 | } 26 | 27 | func (h *SocketHandler) Write(p []byte) (n int, err error) { 28 | if err = h.connect(); err != nil { 29 | return 30 | } 31 | 32 | buf := make([]byte, len(p)+4) 33 | 34 | binary.BigEndian.PutUint32(buf, uint32(len(p))) 35 | 36 | copy(buf[4:], p) 37 | 38 | n, err = h.c.Write(buf) 39 | if err != nil { 40 | h.c.Close() 41 | h.c = nil 42 | } 43 | return 44 | } 45 | 46 | func (h *SocketHandler) Close() error { 47 | if h.c != nil { 48 | h.c.Close() 49 | } 50 | return nil 51 | } 52 | 53 | func (h *SocketHandler) connect() error { 54 | if h.c != nil { 55 | return nil 56 | } 57 | 58 | var err error 59 | h.c, err = net.DialTimeout(h.protocol, h.addr, 20*time.Second) 60 | if err != nil { 61 | return err 62 | } 63 | 64 | return nil 65 | } 66 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 siddontang 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 all 13 | 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 THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/rpl/store.go: -------------------------------------------------------------------------------- 1 | package rpl 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | const ( 8 | InvalidLogID uint64 = 0 9 | ) 10 | 11 | var ( 12 | ErrLogNotFound = errors.New("log not found") 13 | ErrStoreLogID = errors.New("log id is less") 14 | ErrNoBehindLog = errors.New("no behind commit log") 15 | ErrCommitIDBehind = errors.New("commit id is behind last log id") 16 | ) 17 | 18 | type LogStore interface { 19 | GetLog(id uint64, log *Log) error 20 | 21 | FirstID() (uint64, error) 22 | LastID() (uint64, error) 23 | 24 | // if log id is less than current last id, return error 25 | StoreLog(log *Log) error 26 | 27 | // Delete logs before n seconds 28 | PurgeExpired(n int64) error 29 | 30 | Sync() error 31 | 32 | // Clear all logs 33 | Clear() error 34 | 35 | Close() error 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/boltdb/const.go: -------------------------------------------------------------------------------- 1 | package boltdb 2 | 3 | const DBName = "boltdb" 4 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/boltdb/iterator.go: -------------------------------------------------------------------------------- 1 | package boltdb 2 | 3 | import ( 4 | "github.com/boltdb/bolt" 5 | ) 6 | 7 | type Iterator struct { 8 | tx *bolt.Tx 9 | it *bolt.Cursor 10 | key []byte 11 | value []byte 12 | } 13 | 14 | func (it *Iterator) Close() error { 15 | if it.tx != nil { 16 | return it.tx.Rollback() 17 | } else { 18 | return nil 19 | } 20 | } 21 | 22 | func (it *Iterator) First() { 23 | it.key, it.value = it.it.First() 24 | } 25 | 26 | func (it *Iterator) Last() { 27 | it.key, it.value = it.it.Last() 28 | } 29 | 30 | func (it *Iterator) Seek(key []byte) { 31 | it.key, it.value = it.it.Seek(key) 32 | } 33 | 34 | func (it *Iterator) Next() { 35 | it.key, it.value = it.it.Next() 36 | } 37 | func (it *Iterator) Prev() { 38 | it.key, it.value = it.it.Prev() 39 | } 40 | 41 | func (it *Iterator) Valid() bool { 42 | return !(it.key == nil && it.value == nil) 43 | } 44 | 45 | func (it *Iterator) Key() []byte { 46 | return it.key 47 | } 48 | func (it *Iterator) Value() []byte { 49 | return it.value 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/boltdb/snapshot.go: -------------------------------------------------------------------------------- 1 | package boltdb 2 | 3 | import ( 4 | "github.com/boltdb/bolt" 5 | "github.com/siddontang/ledisdb/store/driver" 6 | ) 7 | 8 | type Snapshot struct { 9 | tx *bolt.Tx 10 | b *bolt.Bucket 11 | } 12 | 13 | func newSnapshot(db *DB) (*Snapshot, error) { 14 | tx, err := db.db.Begin(false) 15 | if err != nil { 16 | return nil, err 17 | } 18 | 19 | return &Snapshot{ 20 | tx: tx, 21 | b: tx.Bucket(bucketName)}, nil 22 | } 23 | 24 | func (s *Snapshot) Get(key []byte) ([]byte, error) { 25 | return s.b.Get(key), nil 26 | } 27 | 28 | func (s *Snapshot) NewIterator() driver.IIterator { 29 | return &Iterator{ 30 | tx: nil, 31 | it: s.b.Cursor(), 32 | } 33 | } 34 | 35 | func (s *Snapshot) Close() { 36 | s.tx.Rollback() 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/boltdb/tx.go: -------------------------------------------------------------------------------- 1 | package boltdb 2 | 3 | import ( 4 | "github.com/boltdb/bolt" 5 | "github.com/siddontang/ledisdb/store/driver" 6 | ) 7 | 8 | type Tx struct { 9 | tx *bolt.Tx 10 | b *bolt.Bucket 11 | } 12 | 13 | func (t *Tx) Get(key []byte) ([]byte, error) { 14 | return t.b.Get(key), nil 15 | } 16 | 17 | func (t *Tx) Put(key []byte, value []byte) error { 18 | return t.b.Put(key, value) 19 | } 20 | 21 | func (t *Tx) Delete(key []byte) error { 22 | return t.b.Delete(key) 23 | } 24 | 25 | func (t *Tx) NewIterator() driver.IIterator { 26 | return &Iterator{ 27 | tx: nil, 28 | it: t.b.Cursor(), 29 | } 30 | } 31 | 32 | func (t *Tx) NewWriteBatch() driver.IWriteBatch { 33 | return driver.NewWriteBatch(t) 34 | } 35 | 36 | func (t *Tx) BatchPut(writes []driver.Write) error { 37 | var err error 38 | for _, w := range writes { 39 | if w.Value == nil { 40 | err = t.b.Delete(w.Key) 41 | } else { 42 | err = t.b.Put(w.Key, w.Value) 43 | } 44 | if err != nil { 45 | return err 46 | } 47 | } 48 | return nil 49 | } 50 | 51 | func (t *Tx) SyncBatchPut(writes []driver.Write) error { 52 | return t.BatchPut(writes) 53 | } 54 | 55 | func (t *Tx) Rollback() error { 56 | return t.tx.Rollback() 57 | } 58 | 59 | func (t *Tx) Commit() error { 60 | return t.tx.Commit() 61 | } 62 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/driver/batch.go: -------------------------------------------------------------------------------- 1 | package driver 2 | 3 | import ( 4 | "github.com/syndtr/goleveldb/leveldb" 5 | ) 6 | 7 | type BatchPuter interface { 8 | BatchPut([]Write) error 9 | SyncBatchPut([]Write) error 10 | } 11 | 12 | type Write struct { 13 | Key []byte 14 | Value []byte 15 | } 16 | 17 | type WriteBatch struct { 18 | d *leveldb.Batch 19 | 20 | wb []Write 21 | w BatchPuter 22 | } 23 | 24 | func (wb *WriteBatch) Close() { 25 | wb.d.Reset() 26 | wb.wb = wb.wb[0:0] 27 | } 28 | 29 | func (wb *WriteBatch) Put(key, value []byte) { 30 | if value == nil { 31 | value = []byte{} 32 | } 33 | wb.wb = append(wb.wb, Write{key, value}) 34 | } 35 | 36 | func (wb *WriteBatch) Delete(key []byte) { 37 | wb.wb = append(wb.wb, Write{key, nil}) 38 | } 39 | 40 | func (wb *WriteBatch) Commit() error { 41 | return wb.w.BatchPut(wb.wb) 42 | } 43 | 44 | func (wb *WriteBatch) SyncCommit() error { 45 | return wb.w.SyncBatchPut(wb.wb) 46 | } 47 | 48 | func (wb *WriteBatch) Rollback() error { 49 | wb.wb = wb.wb[0:0] 50 | return nil 51 | } 52 | 53 | func (wb *WriteBatch) Data() []byte { 54 | wb.d.Reset() 55 | for _, w := range wb.wb { 56 | if w.Value == nil { 57 | wb.d.Delete(w.Key) 58 | } else { 59 | wb.d.Put(w.Key, w.Value) 60 | } 61 | } 62 | return wb.d.Dump() 63 | } 64 | 65 | func NewWriteBatch(puter BatchPuter) *WriteBatch { 66 | return &WriteBatch{ 67 | &leveldb.Batch{}, 68 | []Write{}, 69 | puter} 70 | } 71 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/driver/slice.go: -------------------------------------------------------------------------------- 1 | package driver 2 | 3 | type ISlice interface { 4 | Data() []byte 5 | Size() int 6 | Free() 7 | } 8 | 9 | type GoSlice []byte 10 | 11 | func (s GoSlice) Data() []byte { 12 | return []byte(s) 13 | } 14 | 15 | func (s GoSlice) Size() int { 16 | return len(s) 17 | } 18 | 19 | func (s GoSlice) Free() { 20 | 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/driver/store.go: -------------------------------------------------------------------------------- 1 | package driver 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/siddontang/ledisdb/config" 7 | ) 8 | 9 | type Store interface { 10 | String() string 11 | Open(path string, cfg *config.Config) (IDB, error) 12 | Repair(path string, cfg *config.Config) error 13 | } 14 | 15 | var dbs = map[string]Store{} 16 | 17 | func Register(s Store) { 18 | name := s.String() 19 | if _, ok := dbs[name]; ok { 20 | panic(fmt.Errorf("store %s is registered", s)) 21 | } 22 | 23 | dbs[name] = s 24 | } 25 | 26 | func ListStores() []string { 27 | s := []string{} 28 | for k, _ := range dbs { 29 | s = append(s, k) 30 | } 31 | 32 | return s 33 | } 34 | 35 | func GetStore(cfg *config.Config) (Store, error) { 36 | if len(cfg.DBName) == 0 { 37 | cfg.DBName = config.DefaultDBName 38 | } 39 | 40 | s, ok := dbs[cfg.DBName] 41 | if !ok { 42 | return nil, fmt.Errorf("store %s is not registered", cfg.DBName) 43 | } 44 | 45 | return s, nil 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/goleveldb/batch.go: -------------------------------------------------------------------------------- 1 | package goleveldb 2 | 3 | import ( 4 | "github.com/syndtr/goleveldb/leveldb" 5 | ) 6 | 7 | type WriteBatch struct { 8 | db *DB 9 | wbatch *leveldb.Batch 10 | } 11 | 12 | func (w *WriteBatch) Put(key, value []byte) { 13 | w.wbatch.Put(key, value) 14 | } 15 | 16 | func (w *WriteBatch) Delete(key []byte) { 17 | w.wbatch.Delete(key) 18 | } 19 | 20 | func (w *WriteBatch) Commit() error { 21 | return w.db.db.Write(w.wbatch, nil) 22 | } 23 | 24 | func (w *WriteBatch) SyncCommit() error { 25 | return w.db.db.Write(w.wbatch, w.db.syncOpts) 26 | } 27 | 28 | func (w *WriteBatch) Rollback() error { 29 | w.wbatch.Reset() 30 | return nil 31 | } 32 | 33 | func (w *WriteBatch) Close() { 34 | w.wbatch.Reset() 35 | } 36 | 37 | func (w *WriteBatch) Data() []byte { 38 | return w.wbatch.Dump() 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/goleveldb/const.go: -------------------------------------------------------------------------------- 1 | package goleveldb 2 | 3 | const DBName = "goleveldb" 4 | const MemDBName = "memory" 5 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/goleveldb/iterator.go: -------------------------------------------------------------------------------- 1 | package goleveldb 2 | 3 | import ( 4 | "github.com/syndtr/goleveldb/leveldb/iterator" 5 | ) 6 | 7 | type Iterator struct { 8 | it iterator.Iterator 9 | } 10 | 11 | func (it *Iterator) Key() []byte { 12 | return it.it.Key() 13 | } 14 | 15 | func (it *Iterator) Value() []byte { 16 | return it.it.Value() 17 | } 18 | 19 | func (it *Iterator) Close() error { 20 | if it.it != nil { 21 | it.it.Release() 22 | it.it = nil 23 | } 24 | return nil 25 | } 26 | 27 | func (it *Iterator) Valid() bool { 28 | return it.it.Valid() 29 | } 30 | 31 | func (it *Iterator) Next() { 32 | it.it.Next() 33 | } 34 | 35 | func (it *Iterator) Prev() { 36 | it.it.Prev() 37 | } 38 | 39 | func (it *Iterator) First() { 40 | it.it.First() 41 | } 42 | 43 | func (it *Iterator) Last() { 44 | it.it.Last() 45 | } 46 | 47 | func (it *Iterator) Seek(key []byte) { 48 | it.it.Seek(key) 49 | } 50 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/goleveldb/snapshot.go: -------------------------------------------------------------------------------- 1 | package goleveldb 2 | 3 | import ( 4 | "github.com/siddontang/ledisdb/store/driver" 5 | "github.com/syndtr/goleveldb/leveldb" 6 | ) 7 | 8 | type Snapshot struct { 9 | db *DB 10 | snp *leveldb.Snapshot 11 | } 12 | 13 | func (s *Snapshot) Get(key []byte) ([]byte, error) { 14 | return s.snp.Get(key, s.db.iteratorOpts) 15 | } 16 | 17 | func (s *Snapshot) NewIterator() driver.IIterator { 18 | it := &Iterator{ 19 | s.snp.NewIterator(nil, s.db.iteratorOpts), 20 | } 21 | return it 22 | } 23 | 24 | func (s *Snapshot) Close() { 25 | s.snp.Release() 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/leveldb/cache.go: -------------------------------------------------------------------------------- 1 | // +build leveldb 2 | 3 | package leveldb 4 | 5 | // #cgo LDFLAGS: -lleveldb 6 | // #include 7 | // #include "leveldb/c.h" 8 | import "C" 9 | 10 | type Cache struct { 11 | Cache *C.leveldb_cache_t 12 | } 13 | 14 | func NewLRUCache(capacity int) *Cache { 15 | return &Cache{C.leveldb_cache_create_lru(C.size_t(capacity))} 16 | } 17 | 18 | func (c *Cache) Close() { 19 | C.leveldb_cache_destroy(c.Cache) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/leveldb/const.go: -------------------------------------------------------------------------------- 1 | package leveldb 2 | 3 | const DBName = "leveldb" 4 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/leveldb/filterpolicy.go: -------------------------------------------------------------------------------- 1 | // +build leveldb 2 | 3 | package leveldb 4 | 5 | // #cgo LDFLAGS: -lleveldb 6 | // #include 7 | // #include "leveldb/c.h" 8 | import "C" 9 | 10 | type FilterPolicy struct { 11 | Policy *C.leveldb_filterpolicy_t 12 | } 13 | 14 | func NewBloomFilter(bitsPerKey int) *FilterPolicy { 15 | policy := C.leveldb_filterpolicy_create_bloom(C.int(bitsPerKey)) 16 | return &FilterPolicy{policy} 17 | } 18 | 19 | func (fp *FilterPolicy) Close() { 20 | C.leveldb_filterpolicy_destroy(fp.Policy) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/leveldb/leveldb_ext.h: -------------------------------------------------------------------------------- 1 | // +build leveldb 2 | 3 | #ifndef LEVELDB_EXT_H 4 | #define LEVELDB_EXT_H 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | #include "leveldb/c.h" 11 | 12 | 13 | // /* Returns NULL if not found. Otherwise stores the value in **valptr. 14 | // Stores the length of the value in *vallen. 15 | // Returns a context must be later to free*/ 16 | // extern void* leveldb_get_ext( 17 | // leveldb_t* db, 18 | // const leveldb_readoptions_t* options, 19 | // const char* key, size_t keylen, 20 | // char** valptr, 21 | // size_t* vallen, 22 | // char** errptr); 23 | 24 | // // Free context returns by leveldb_get_ext 25 | // extern void leveldb_get_free_ext(void* context); 26 | 27 | 28 | // Below iterator functions like leveldb iterator but returns valid status for iterator 29 | extern unsigned char leveldb_iter_seek_to_first_ext(leveldb_iterator_t*); 30 | extern unsigned char leveldb_iter_seek_to_last_ext(leveldb_iterator_t*); 31 | extern unsigned char leveldb_iter_seek_ext(leveldb_iterator_t*, const char* k, size_t klen); 32 | extern unsigned char leveldb_iter_next_ext(leveldb_iterator_t*); 33 | extern unsigned char leveldb_iter_prev_ext(leveldb_iterator_t*); 34 | 35 | extern void leveldb_writebatch_iterate_ext(leveldb_writebatch_t*, void* p); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/leveldb/levigo-license: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Jeffrey M Hodges 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/leveldb/slice.go: -------------------------------------------------------------------------------- 1 | // +build leveldb 2 | 3 | package leveldb 4 | 5 | // #cgo LDFLAGS: -lleveldb 6 | // #include "leveldb/c.h" 7 | import "C" 8 | 9 | import ( 10 | "reflect" 11 | "unsafe" 12 | ) 13 | 14 | type CSlice struct { 15 | data unsafe.Pointer 16 | size int 17 | } 18 | 19 | func NewCSlice(p unsafe.Pointer, n int) *CSlice { 20 | return &CSlice{p, n} 21 | } 22 | 23 | func (s *CSlice) Data() []byte { 24 | var value []byte 25 | 26 | sH := (*reflect.SliceHeader)(unsafe.Pointer(&value)) 27 | sH.Cap = int(s.size) 28 | sH.Len = int(s.size) 29 | sH.Data = uintptr(s.data) 30 | 31 | return value 32 | } 33 | 34 | func (s *CSlice) Size() int { 35 | return int(s.size) 36 | } 37 | 38 | func (s *CSlice) Free() { 39 | C.leveldb_free(s.data) 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/leveldb/snapshot.go: -------------------------------------------------------------------------------- 1 | // +build leveldb 2 | 3 | package leveldb 4 | 5 | // #cgo LDFLAGS: -lleveldb 6 | // #include "leveldb/c.h" 7 | import "C" 8 | 9 | import ( 10 | "github.com/siddontang/ledisdb/store/driver" 11 | ) 12 | 13 | type Snapshot struct { 14 | db *DB 15 | snap *C.leveldb_snapshot_t 16 | readOpts *ReadOptions 17 | iteratorOpts *ReadOptions 18 | } 19 | 20 | func (s *Snapshot) Get(key []byte) ([]byte, error) { 21 | return s.db.get(s.readOpts, key) 22 | } 23 | 24 | func (s *Snapshot) GetSlice(key []byte) (driver.ISlice, error) { 25 | return s.db.getSlice(s.readOpts, key) 26 | } 27 | 28 | func (s *Snapshot) NewIterator() driver.IIterator { 29 | it := new(Iterator) 30 | it.it = C.leveldb_create_iterator(s.db.db, s.db.iteratorOpts.Opt) 31 | return it 32 | 33 | } 34 | 35 | func (s *Snapshot) Close() { 36 | C.leveldb_release_snapshot(s.db.db, s.snap) 37 | s.iteratorOpts.Close() 38 | s.readOpts.Close() 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/leveldb/util.go: -------------------------------------------------------------------------------- 1 | // +build leveldb 2 | 3 | package leveldb 4 | 5 | // #include "leveldb/c.h" 6 | import "C" 7 | 8 | import ( 9 | "fmt" 10 | "reflect" 11 | "unsafe" 12 | ) 13 | 14 | func boolToUchar(b bool) C.uchar { 15 | uc := C.uchar(0) 16 | if b { 17 | uc = C.uchar(1) 18 | } 19 | return uc 20 | } 21 | 22 | func ucharToBool(uc C.uchar) bool { 23 | if uc == C.uchar(0) { 24 | return false 25 | } 26 | return true 27 | } 28 | 29 | func saveError(errStr *C.char) error { 30 | if errStr != nil { 31 | gs := C.GoString(errStr) 32 | C.leveldb_free(unsafe.Pointer(errStr)) 33 | return fmt.Errorf(gs) 34 | } 35 | return nil 36 | } 37 | 38 | func slice(p unsafe.Pointer, n int) []byte { 39 | var b []byte 40 | pbyte := (*reflect.SliceHeader)(unsafe.Pointer(&b)) 41 | pbyte.Data = uintptr(p) 42 | pbyte.Len = n 43 | pbyte.Cap = n 44 | return b 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/mdb/const.go: -------------------------------------------------------------------------------- 1 | package mdb 2 | 3 | const DBName = "lmdb" 4 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/mdb/influxdb_license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013-2014 Errplane Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | 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, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/mdb/snapshot.go: -------------------------------------------------------------------------------- 1 | // +build lmdb 2 | 3 | package mdb 4 | 5 | import ( 6 | "github.com/siddontang/ledisdb/store/driver" 7 | mdb "github.com/siddontang/ledisdb/vendor/gomdb" 8 | ) 9 | 10 | type Snapshot struct { 11 | db mdb.DBI 12 | tx *mdb.Txn 13 | } 14 | 15 | func newSnapshot(db MDB) (*Snapshot, error) { 16 | tx, err := db.env.BeginTxn(nil, mdb.RDONLY) 17 | if err != nil { 18 | return nil, err 19 | } 20 | 21 | return &Snapshot{db.db, tx}, nil 22 | } 23 | 24 | func (s *Snapshot) Get(key []byte) ([]byte, error) { 25 | v, err := s.tx.Get(s.db, key) 26 | if err == mdb.NotFound { 27 | return nil, nil 28 | } 29 | return v, err 30 | } 31 | 32 | func (s *Snapshot) NewIterator() driver.IIterator { 33 | c, err := s.tx.CursorOpen(s.db) 34 | if err != nil { 35 | return &MDBIterator{nil, nil, nil, nil, false, err, false} 36 | } 37 | 38 | return &MDBIterator{nil, nil, c, s.tx, true, nil, false} 39 | } 40 | 41 | func (s *Snapshot) Close() { 42 | s.tx.Commit() 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/rocksdb/cache.go: -------------------------------------------------------------------------------- 1 | // +build rocksdb 2 | 3 | package rocksdb 4 | 5 | // #cgo LDFLAGS: -lrocksdb 6 | // #include 7 | // #include "rocksdb/c.h" 8 | import "C" 9 | 10 | type Cache struct { 11 | Cache *C.rocksdb_cache_t 12 | } 13 | 14 | func NewLRUCache(capacity int) *Cache { 15 | return &Cache{C.rocksdb_cache_create_lru(C.size_t(capacity))} 16 | } 17 | 18 | func (c *Cache) Close() { 19 | C.rocksdb_cache_destroy(c.Cache) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/rocksdb/const.go: -------------------------------------------------------------------------------- 1 | package rocksdb 2 | 3 | const DBName = "rocksdb" 4 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/rocksdb/env.go: -------------------------------------------------------------------------------- 1 | // +build rocksdb 2 | 3 | package rocksdb 4 | 5 | // #cgo LDFLAGS: -lrocksdb 6 | // #include "rocksdb/c.h" 7 | import "C" 8 | 9 | type Env struct { 10 | Env *C.rocksdb_env_t 11 | } 12 | 13 | func NewDefaultEnv() *Env { 14 | return &Env{C.rocksdb_create_default_env()} 15 | } 16 | 17 | func (env *Env) SetHighPriorityBackgroundThreads(n int) { 18 | C.rocksdb_env_set_high_priority_background_threads(env.Env, C.int(n)) 19 | } 20 | 21 | func (env *Env) SetBackgroundThreads(n int) { 22 | C.rocksdb_env_set_background_threads(env.Env, C.int(n)) 23 | } 24 | 25 | func (env *Env) Close() { 26 | C.rocksdb_env_destroy(env.Env) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/rocksdb/filterpolicy.go: -------------------------------------------------------------------------------- 1 | // +build rocksdb 2 | 3 | package rocksdb 4 | 5 | // #cgo LDFLAGS: -lrocksdb 6 | // #include 7 | // #include "rocksdb/c.h" 8 | import "C" 9 | 10 | type FilterPolicy struct { 11 | Policy *C.rocksdb_filterpolicy_t 12 | } 13 | 14 | func NewBloomFilter(bitsPerKey int) *FilterPolicy { 15 | policy := C.rocksdb_filterpolicy_create_bloom(C.int(bitsPerKey)) 16 | return &FilterPolicy{policy} 17 | } 18 | 19 | func (fp *FilterPolicy) Close() { 20 | C.rocksdb_filterpolicy_destroy(fp.Policy) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/rocksdb/rocksdb_ext.cc: -------------------------------------------------------------------------------- 1 | // +build rocksdb 2 | 3 | #include "rocksdb_ext.h" 4 | 5 | #include 6 | #include 7 | 8 | extern "C" { 9 | 10 | unsigned char rocksdb_iter_seek_to_first_ext(rocksdb_iterator_t* iter) { 11 | rocksdb_iter_seek_to_first(iter); 12 | return rocksdb_iter_valid(iter); 13 | } 14 | 15 | unsigned char rocksdb_iter_seek_to_last_ext(rocksdb_iterator_t* iter) { 16 | rocksdb_iter_seek_to_last(iter); 17 | return rocksdb_iter_valid(iter); 18 | } 19 | 20 | unsigned char rocksdb_iter_seek_ext(rocksdb_iterator_t* iter, const char* k, size_t klen) { 21 | rocksdb_iter_seek(iter, k, klen); 22 | return rocksdb_iter_valid(iter); 23 | } 24 | 25 | unsigned char rocksdb_iter_next_ext(rocksdb_iterator_t* iter) { 26 | rocksdb_iter_next(iter); 27 | return rocksdb_iter_valid(iter); 28 | } 29 | 30 | unsigned char rocksdb_iter_prev_ext(rocksdb_iterator_t* iter) { 31 | rocksdb_iter_prev(iter); 32 | return rocksdb_iter_valid(iter); 33 | } 34 | 35 | void rocksdb_write_ext(rocksdb_t* db, 36 | const rocksdb_writeoptions_t* options, 37 | rocksdb_writebatch_t* batch, char** errptr) { 38 | rocksdb_write(db, options, batch, errptr); 39 | if(*errptr == NULL) { 40 | rocksdb_writebatch_clear(batch); 41 | } 42 | } 43 | 44 | } -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/rocksdb/rocksdb_ext.h: -------------------------------------------------------------------------------- 1 | // +build rocksdb 2 | 3 | #ifndef ROCKSDB_EXT_H 4 | #define ROCKSDB_EXT_H 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | #include "rocksdb/c.h" 11 | 12 | // Below iterator functions like rocksdb iterator but returns valid status for iterator 13 | extern unsigned char rocksdb_iter_seek_to_first_ext(rocksdb_iterator_t*); 14 | extern unsigned char rocksdb_iter_seek_to_last_ext(rocksdb_iterator_t*); 15 | extern unsigned char rocksdb_iter_seek_ext(rocksdb_iterator_t*, const char* k, size_t klen); 16 | extern unsigned char rocksdb_iter_next_ext(rocksdb_iterator_t*); 17 | extern unsigned char rocksdb_iter_prev_ext(rocksdb_iterator_t*); 18 | extern void rocksdb_write_ext(rocksdb_t* db, const rocksdb_writeoptions_t* options, rocksdb_writebatch_t* batch, char** errptr); 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | #endif -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/rocksdb/slice.go: -------------------------------------------------------------------------------- 1 | //+build rocksdb 2 | 3 | package rocksdb 4 | 5 | // #cgo LDFLAGS: -lrocksdb 6 | // #include 7 | // #include 8 | import "C" 9 | 10 | import ( 11 | "reflect" 12 | "unsafe" 13 | ) 14 | 15 | type CSlice struct { 16 | data unsafe.Pointer 17 | size int 18 | } 19 | 20 | func NewCSlice(p unsafe.Pointer, n int) *CSlice { 21 | return &CSlice{p, n} 22 | } 23 | 24 | func (s *CSlice) Data() []byte { 25 | var value []byte 26 | 27 | sH := (*reflect.SliceHeader)(unsafe.Pointer(&value)) 28 | sH.Cap = int(s.size) 29 | sH.Len = int(s.size) 30 | sH.Data = uintptr(s.data) 31 | 32 | return value 33 | } 34 | 35 | func (s *CSlice) Size() int { 36 | return int(s.size) 37 | } 38 | 39 | func (s *CSlice) Free() { 40 | C.free(s.data) 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/rocksdb/snapshot.go: -------------------------------------------------------------------------------- 1 | // +build rocksdb 2 | 3 | package rocksdb 4 | 5 | // #cgo LDFLAGS: -lrocksdb 6 | // #include "rocksdb/c.h" 7 | import "C" 8 | 9 | import ( 10 | "github.com/siddontang/ledisdb/store/driver" 11 | ) 12 | 13 | type Snapshot struct { 14 | db *DB 15 | snap *C.rocksdb_snapshot_t 16 | readOpts *ReadOptions 17 | iteratorOpts *ReadOptions 18 | } 19 | 20 | func (s *Snapshot) Get(key []byte) ([]byte, error) { 21 | return s.db.get(s.readOpts, key) 22 | } 23 | 24 | func (s *Snapshot) GetSlice(key []byte) (driver.ISlice, error) { 25 | return s.db.getSlice(s.readOpts, key) 26 | } 27 | 28 | func (s *Snapshot) NewIterator() driver.IIterator { 29 | it := new(Iterator) 30 | it.it = C.rocksdb_create_iterator(s.db.db, s.db.iteratorOpts.Opt) 31 | return it 32 | 33 | } 34 | 35 | func (s *Snapshot) Close() { 36 | C.rocksdb_release_snapshot(s.db.db, s.snap) 37 | s.iteratorOpts.Close() 38 | s.readOpts.Close() 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/rocksdb/util.go: -------------------------------------------------------------------------------- 1 | // +build rocksdb 2 | 3 | package rocksdb 4 | 5 | // #include 6 | // #include "rocksdb/c.h" 7 | import "C" 8 | 9 | import ( 10 | "fmt" 11 | "reflect" 12 | "unsafe" 13 | ) 14 | 15 | func boolToUchar(b bool) C.uchar { 16 | uc := C.uchar(0) 17 | if b { 18 | uc = C.uchar(1) 19 | } 20 | return uc 21 | } 22 | 23 | func ucharToBool(uc C.uchar) bool { 24 | if uc == C.uchar(0) { 25 | return false 26 | } 27 | return true 28 | } 29 | 30 | func boolToInt(b bool) C.int { 31 | uc := C.int(0) 32 | if b { 33 | uc = C.int(1) 34 | } 35 | return uc 36 | } 37 | 38 | func saveError(errStr *C.char) error { 39 | if errStr != nil { 40 | gs := C.GoString(errStr) 41 | C.free(unsafe.Pointer(errStr)) 42 | return fmt.Errorf(gs) 43 | } 44 | return nil 45 | } 46 | 47 | func slice(p unsafe.Pointer, n int) []byte { 48 | var b []byte 49 | pbyte := (*reflect.SliceHeader)(unsafe.Pointer(&b)) 50 | pbyte.Data = uintptr(p) 51 | pbyte.Len = n 52 | pbyte.Cap = n 53 | return b 54 | } 55 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/slice.go: -------------------------------------------------------------------------------- 1 | package store 2 | 3 | import ( 4 | "github.com/siddontang/ledisdb/store/driver" 5 | ) 6 | 7 | type Slice interface { 8 | driver.ISlice 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/snapshot.go: -------------------------------------------------------------------------------- 1 | package store 2 | 3 | import ( 4 | "github.com/siddontang/ledisdb/store/driver" 5 | ) 6 | 7 | type Snapshot struct { 8 | driver.ISnapshot 9 | st *Stat 10 | } 11 | 12 | func (s *Snapshot) NewIterator() *Iterator { 13 | it := new(Iterator) 14 | it.it = s.ISnapshot.NewIterator() 15 | it.st = s.st 16 | 17 | s.st.IterNum.Add(1) 18 | 19 | return it 20 | } 21 | 22 | func (s *Snapshot) Get(key []byte) ([]byte, error) { 23 | v, err := s.ISnapshot.Get(key) 24 | s.st.statGet(v, err) 25 | return v, err 26 | } 27 | 28 | func (s *Snapshot) GetSlice(key []byte) (Slice, error) { 29 | if d, ok := s.ISnapshot.(driver.ISliceGeter); ok { 30 | v, err := d.GetSlice(key) 31 | s.st.statGet(v, err) 32 | return v, err 33 | } else { 34 | v, err := s.Get(key) 35 | if err != nil { 36 | return nil, err 37 | } else if v == nil { 38 | return nil, nil 39 | } else { 40 | return driver.GoSlice(v), nil 41 | } 42 | } 43 | } 44 | 45 | func (s *Snapshot) Close() { 46 | s.st.SnapshotCloseNum.Add(1) 47 | s.ISnapshot.Close() 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/stat.go: -------------------------------------------------------------------------------- 1 | package store 2 | 3 | import ( 4 | "github.com/siddontang/go/sync2" 5 | ) 6 | 7 | type Stat struct { 8 | GetNum sync2.AtomicInt64 9 | GetMissingNum sync2.AtomicInt64 10 | GetTotalTime sync2.AtomicDuration 11 | PutNum sync2.AtomicInt64 12 | DeleteNum sync2.AtomicInt64 13 | IterNum sync2.AtomicInt64 14 | IterSeekNum sync2.AtomicInt64 15 | IterCloseNum sync2.AtomicInt64 16 | SnapshotNum sync2.AtomicInt64 17 | SnapshotCloseNum sync2.AtomicInt64 18 | BatchNum sync2.AtomicInt64 19 | BatchCommitNum sync2.AtomicInt64 20 | BatchCommitTotalTime sync2.AtomicDuration 21 | TxNum sync2.AtomicInt64 22 | TxCommitNum sync2.AtomicInt64 23 | TxCloseNum sync2.AtomicInt64 24 | CompactNum sync2.AtomicInt64 25 | CompactTotalTime sync2.AtomicDuration 26 | } 27 | 28 | func (st *Stat) statGet(v interface{}, err error) { 29 | st.GetNum.Add(1) 30 | if v == nil && err == nil { 31 | st.GetMissingNum.Add(1) 32 | } 33 | } 34 | 35 | func (st *Stat) Reset() { 36 | *st = Stat{} 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/ledisdb/store/store.go: -------------------------------------------------------------------------------- 1 | package store 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "path" 7 | 8 | "github.com/siddontang/ledisdb/config" 9 | "github.com/siddontang/ledisdb/store/driver" 10 | 11 | _ "github.com/siddontang/ledisdb/store/boltdb" 12 | _ "github.com/siddontang/ledisdb/store/goleveldb" 13 | _ "github.com/siddontang/ledisdb/store/leveldb" 14 | _ "github.com/siddontang/ledisdb/store/mdb" 15 | _ "github.com/siddontang/ledisdb/store/rocksdb" 16 | ) 17 | 18 | func getStorePath(cfg *config.Config) string { 19 | if len(cfg.DBPath) > 0 { 20 | return cfg.DBPath 21 | } else { 22 | return path.Join(cfg.DataDir, fmt.Sprintf("%s_data", cfg.DBName)) 23 | } 24 | } 25 | 26 | func Open(cfg *config.Config) (*DB, error) { 27 | s, err := driver.GetStore(cfg) 28 | if err != nil { 29 | return nil, err 30 | } 31 | 32 | path := getStorePath(cfg) 33 | 34 | if err := os.MkdirAll(path, 0755); err != nil { 35 | return nil, err 36 | } 37 | 38 | idb, err := s.Open(path, cfg) 39 | if err != nil { 40 | return nil, err 41 | } 42 | 43 | db := new(DB) 44 | db.db = idb 45 | db.name = s.String() 46 | db.st = &Stat{} 47 | db.cfg = cfg 48 | 49 | return db, nil 50 | } 51 | 52 | func Repair(cfg *config.Config) error { 53 | s, err := driver.GetStore(cfg) 54 | if err != nil { 55 | return err 56 | } 57 | 58 | path := getStorePath(cfg) 59 | 60 | return s.Repair(path, cfg) 61 | } 62 | 63 | func init() { 64 | } 65 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/rdb/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 siddontang 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 all 13 | 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 THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/siddontang/rdb/README.md: -------------------------------------------------------------------------------- 1 | # rdb 2 | 3 | Handling Redis RDB format. 4 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/rdb/encode.go: -------------------------------------------------------------------------------- 1 | package rdb 2 | 3 | import ( 4 | "bytes" 5 | "fmt" 6 | "github.com/cupcake/rdb" 7 | ) 8 | 9 | func Dump(obj interface{}) ([]byte, error) { 10 | var buf bytes.Buffer 11 | 12 | e := rdb.NewEncoder(&buf) 13 | 14 | switch v := obj.(type) { 15 | case String: 16 | e.EncodeType(rdb.TypeString) 17 | e.EncodeString(v) 18 | case Hash: 19 | e.EncodeType(rdb.TypeHash) 20 | e.EncodeLength(uint32(len(v))) 21 | 22 | for i := 0; i < len(v); i++ { 23 | e.EncodeString(v[i].Field) 24 | e.EncodeString(v[i].Value) 25 | } 26 | case List: 27 | e.EncodeType(rdb.TypeList) 28 | e.EncodeLength(uint32(len(v))) 29 | for i := 0; i < len(v); i++ { 30 | e.EncodeString(v[i]) 31 | } 32 | case Set: 33 | e.EncodeType(rdb.TypeSet) 34 | e.EncodeLength(uint32(len(v))) 35 | for i := 0; i < len(v); i++ { 36 | e.EncodeString(v[i]) 37 | } 38 | case ZSet: 39 | e.EncodeType(rdb.TypeZSet) 40 | e.EncodeLength(uint32(len(v))) 41 | for i := 0; i < len(v); i++ { 42 | e.EncodeString(v[i].Member) 43 | e.EncodeFloat(v[i].Score) 44 | } 45 | default: 46 | return nil, fmt.Errorf("invalid dump type %T", obj) 47 | } 48 | 49 | e.EncodeDumpFooter() 50 | 51 | return buf.Bytes(), nil 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/siddontang/rdb/wandoujia-license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Wandoujia Inc. 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 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2012 Suryandaru Triandana 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 15 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 16 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 17 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 18 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 19 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 20 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/comparer/bytes_comparer.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package comparer 8 | 9 | import "bytes" 10 | 11 | type bytesComparer struct{} 12 | 13 | func (bytesComparer) Compare(a, b []byte) int { 14 | return bytes.Compare(a, b) 15 | } 16 | 17 | func (bytesComparer) Name() string { 18 | return "leveldb.BytewiseComparator" 19 | } 20 | 21 | func (bytesComparer) Separator(dst, a, b []byte) []byte { 22 | i, n := 0, len(a) 23 | if n > len(b) { 24 | n = len(b) 25 | } 26 | for ; i < n && a[i] == b[i]; i++ { 27 | } 28 | if i >= n { 29 | // Do not shorten if one string is a prefix of the other 30 | } else if c := a[i]; c < 0xff && c+1 < b[i] { 31 | dst = append(dst, a[:i+1]...) 32 | dst[i]++ 33 | return dst 34 | } 35 | return nil 36 | } 37 | 38 | func (bytesComparer) Successor(dst, b []byte) []byte { 39 | for i, c := range b { 40 | if c != 0xff { 41 | dst = append(dst, b[:i+1]...) 42 | dst[i]++ 43 | return dst 44 | } 45 | } 46 | return nil 47 | } 48 | 49 | // DefaultComparer are default implementation of the Comparer interface. 50 | // It uses the natural ordering, consistent with bytes.Compare. 51 | var DefaultComparer = bytesComparer{} 52 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/errors.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package leveldb 8 | 9 | import ( 10 | "github.com/syndtr/goleveldb/leveldb/errors" 11 | ) 12 | 13 | var ( 14 | ErrNotFound = errors.ErrNotFound 15 | ErrReadOnly = errors.New("leveldb: read-only mode") 16 | ErrSnapshotReleased = errors.New("leveldb: snapshot released") 17 | ErrIterReleased = errors.New("leveldb: iterator released") 18 | ErrClosed = errors.New("leveldb: closed") 19 | ) 20 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/filter.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package leveldb 8 | 9 | import ( 10 | "github.com/syndtr/goleveldb/leveldb/filter" 11 | ) 12 | 13 | type iFilter struct { 14 | filter.Filter 15 | } 16 | 17 | func (f iFilter) Contains(filter, key []byte) bool { 18 | return f.Filter.Contains(filter, internalKey(key).ukey()) 19 | } 20 | 21 | func (f iFilter) NewGenerator() filter.FilterGenerator { 22 | return iFilterGenerator{f.Filter.NewGenerator()} 23 | } 24 | 25 | type iFilterGenerator struct { 26 | filter.FilterGenerator 27 | } 28 | 29 | func (g iFilterGenerator) Add(key []byte) { 30 | g.FilterGenerator.Add(internalKey(key).ukey()) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/util/crc32.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The LevelDB-Go Authors. All rights reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style license that can be 4 | // found in the LICENSE file. 5 | 6 | package util 7 | 8 | import ( 9 | "hash/crc32" 10 | ) 11 | 12 | var table = crc32.MakeTable(crc32.Castagnoli) 13 | 14 | // CRC is a CRC-32 checksum computed using Castagnoli's polynomial. 15 | type CRC uint32 16 | 17 | // NewCRC creates a new crc based on the given bytes. 18 | func NewCRC(b []byte) CRC { 19 | return CRC(0).Update(b) 20 | } 21 | 22 | // Update updates the crc with the given bytes. 23 | func (c CRC) Update(b []byte) CRC { 24 | return CRC(crc32.Update(uint32(c), table, b)) 25 | } 26 | 27 | // Value returns a masked crc. 28 | func (c CRC) Value() uint32 { 29 | return uint32(c>>15|c<<17) + 0xa282ead8 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/util/hash.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package util 8 | 9 | import ( 10 | "encoding/binary" 11 | ) 12 | 13 | // Hash return hash of the given data. 14 | func Hash(data []byte, seed uint32) uint32 { 15 | // Similar to murmur hash 16 | const ( 17 | m = uint32(0xc6a4a793) 18 | r = uint32(24) 19 | ) 20 | var ( 21 | h = seed ^ (uint32(len(data)) * m) 22 | i int 23 | ) 24 | 25 | for n := len(data) - len(data)%4; i < n; i += 4 { 26 | h += binary.LittleEndian.Uint32(data[i:]) 27 | h *= m 28 | h ^= (h >> 16) 29 | } 30 | 31 | switch len(data) - i { 32 | default: 33 | panic("not reached") 34 | case 3: 35 | h += uint32(data[i+2]) << 16 36 | fallthrough 37 | case 2: 38 | h += uint32(data[i+1]) << 8 39 | fallthrough 40 | case 1: 41 | h += uint32(data[i]) 42 | h *= m 43 | h ^= (h >> r) 44 | case 0: 45 | } 46 | 47 | return h 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/util/range.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package util 8 | 9 | // Range is a key range. 10 | type Range struct { 11 | // Start of the key range, include in the range. 12 | Start []byte 13 | 14 | // Limit of the key range, not include in the range. 15 | Limit []byte 16 | } 17 | 18 | // BytesPrefix returns key range that satisfy the given prefix. 19 | // This only applicable for the standard 'bytes comparer'. 20 | func BytesPrefix(prefix []byte) *Range { 21 | var limit []byte 22 | for i := len(prefix) - 1; i >= 0; i-- { 23 | c := prefix[i] 24 | if c < 0xff { 25 | limit = make([]byte, i+1) 26 | copy(limit, prefix) 27 | limit[i] = c + 1 28 | break 29 | } 30 | } 31 | return &Range{prefix, limit} 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/xuri/excelize/excelize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/vendor/github.com/xuri/excelize/excelize.png -------------------------------------------------------------------------------- /vendor/github.com/xuri/excelize/xmlContentTypes.go: -------------------------------------------------------------------------------- 1 | package excelize 2 | 3 | import "encoding/xml" 4 | 5 | // xlsxTypes directly maps the types element of content types for relationship 6 | // parts, it takes a Multipurpose Internet Mail Extension (MIME) media type as a 7 | // value. 8 | type xlsxTypes struct { 9 | XMLName xml.Name `xml:"http://schemas.openxmlformats.org/package/2006/content-types Types"` 10 | Overrides []xlsxOverride `xml:"Override"` 11 | Defaults []xlsxDefault `xml:"Default"` 12 | } 13 | 14 | // xlsxOverride directly maps the override element in the namespace 15 | // http://schemas.openxmlformats.org/package/2006/content-types 16 | type xlsxOverride struct { 17 | PartName string `xml:",attr"` 18 | ContentType string `xml:",attr"` 19 | } 20 | 21 | // xlsxDefault directly maps the default element in the namespace 22 | // http://schemas.openxmlformats.org/package/2006/content-types 23 | type xlsxDefault struct { 24 | Extension string `xml:",attr"` 25 | ContentType string `xml:",attr"` 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for ARM, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-28 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm64,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for AMD64, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, DragonFly 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-64 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-88 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-112 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-64 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-88 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for AMD64, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 23 | CALL runtime·entersyscall(SB) 24 | MOVQ a1+8(FP), DI 25 | MOVQ a2+16(FP), SI 26 | MOVQ a3+24(FP), DX 27 | MOVQ $0, R10 28 | MOVQ $0, R8 29 | MOVQ $0, R9 30 | MOVQ trap+0(FP), AX // syscall entry 31 | SYSCALL 32 | MOVQ AX, r1+32(FP) 33 | MOVQ DX, r2+40(FP) 34 | CALL runtime·exitsyscall(SB) 35 | RET 36 | 37 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 38 | JMP syscall·RawSyscall(SB) 39 | 40 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 41 | JMP syscall·RawSyscall6(SB) 42 | 43 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 44 | MOVQ a1+8(FP), DI 45 | MOVQ a2+16(FP), SI 46 | MOVQ a3+24(FP), DX 47 | MOVQ $0, R10 48 | MOVQ $0, R8 49 | MOVQ $0, R9 50 | MOVQ trap+0(FP), AX // syscall entry 51 | SYSCALL 52 | MOVQ AX, r1+32(FP) 53 | MOVQ DX, r2+40(FP) 54 | RET 55 | 56 | TEXT ·gettimeofday(SB),NOSPLIT,$0-16 57 | JMP syscall·gettimeofday(SB) 58 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for arm, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 23 | BL runtime·entersyscall(SB) 24 | MOVW trap+0(FP), R7 25 | MOVW a1+4(FP), R0 26 | MOVW a2+8(FP), R1 27 | MOVW a3+12(FP), R2 28 | MOVW $0, R3 29 | MOVW $0, R4 30 | MOVW $0, R5 31 | SWI $0 32 | MOVW R0, r1+16(FP) 33 | MOVW $0, R0 34 | MOVW R0, r2+20(FP) 35 | BL runtime·exitsyscall(SB) 36 | RET 37 | 38 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 39 | B syscall·RawSyscall(SB) 40 | 41 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 42 | B syscall·RawSyscall6(SB) 43 | 44 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 45 | MOVW trap+0(FP), R7 // syscall entry 46 | MOVW a1+4(FP), R0 47 | MOVW a2+8(FP), R1 48 | MOVW a3+12(FP), R2 49 | SWI $0 50 | MOVW R0, r1+16(FP) 51 | MOVW $0, R0 52 | MOVW R0, r2+20(FP) 53 | RET 54 | 55 | TEXT ·seek(SB),NOSPLIT,$0-28 56 | B syscall·seek(SB) 57 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build arm64 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | B syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | B syscall·Syscall6(SB) 19 | 20 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 21 | BL runtime·entersyscall(SB) 22 | MOVD a1+8(FP), R0 23 | MOVD a2+16(FP), R1 24 | MOVD a3+24(FP), R2 25 | MOVD $0, R3 26 | MOVD $0, R4 27 | MOVD $0, R5 28 | MOVD trap+0(FP), R8 // syscall entry 29 | SVC 30 | MOVD R0, r1+32(FP) // r1 31 | MOVD R1, r2+40(FP) // r2 32 | BL runtime·exitsyscall(SB) 33 | RET 34 | 35 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 36 | B syscall·RawSyscall(SB) 37 | 38 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 39 | B syscall·RawSyscall6(SB) 40 | 41 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 42 | MOVD a1+8(FP), R0 43 | MOVD a2+16(FP), R1 44 | MOVD a3+24(FP), R2 45 | MOVD $0, R3 46 | MOVD $0, R4 47 | MOVD $0, R5 48 | MOVD trap+0(FP), R8 // syscall entry 49 | SVC 50 | MOVD R0, r1+32(FP) 51 | MOVD R1, r2+40(FP) 52 | RET 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mips64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build mips64 mips64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for mips64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | JMP syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | JMP syscall·Syscall6(SB) 23 | 24 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 25 | JAL runtime·entersyscall(SB) 26 | MOVV a1+8(FP), R4 27 | MOVV a2+16(FP), R5 28 | MOVV a3+24(FP), R6 29 | MOVV R0, R7 30 | MOVV R0, R8 31 | MOVV R0, R9 32 | MOVV trap+0(FP), R2 // syscall entry 33 | SYSCALL 34 | MOVV R2, r1+32(FP) 35 | MOVV R3, r2+40(FP) 36 | JAL runtime·exitsyscall(SB) 37 | RET 38 | 39 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 40 | JMP syscall·RawSyscall(SB) 41 | 42 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 43 | JMP syscall·RawSyscall6(SB) 44 | 45 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 46 | MOVV a1+8(FP), R4 47 | MOVV a2+16(FP), R5 48 | MOVV a3+24(FP), R6 49 | MOVV R0, R7 50 | MOVV R0, R8 51 | MOVV R0, R9 52 | MOVV trap+0(FP), R2 // syscall entry 53 | SYSCALL 54 | MOVV R2, r1+32(FP) 55 | MOVV R3, r2+40(FP) 56 | RET 57 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mipsx.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build mips mipsle 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for mips, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-28 19 | JMP syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 22 | JMP syscall·Syscall6(SB) 23 | 24 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 25 | JMP syscall·Syscall9(SB) 26 | 27 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 28 | JAL runtime·entersyscall(SB) 29 | MOVW a1+4(FP), R4 30 | MOVW a2+8(FP), R5 31 | MOVW a3+12(FP), R6 32 | MOVW R0, R7 33 | MOVW trap+0(FP), R2 // syscall entry 34 | SYSCALL 35 | MOVW R2, r1+16(FP) // r1 36 | MOVW R3, r2+20(FP) // r2 37 | JAL runtime·exitsyscall(SB) 38 | RET 39 | 40 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 41 | JMP syscall·RawSyscall(SB) 42 | 43 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 44 | JMP syscall·RawSyscall6(SB) 45 | 46 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 47 | MOVW a1+4(FP), R4 48 | MOVW a2+8(FP), R5 49 | MOVW a3+12(FP), R6 50 | MOVW trap+0(FP), R2 // syscall entry 51 | SYSCALL 52 | MOVW R2, r1+16(FP) 53 | MOVW R3, r2+20(FP) 54 | RET 55 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build ppc64 ppc64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for ppc64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | BR syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | BR syscall·Syscall6(SB) 23 | 24 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 25 | BL runtime·entersyscall(SB) 26 | MOVD a1+8(FP), R3 27 | MOVD a2+16(FP), R4 28 | MOVD a3+24(FP), R5 29 | MOVD R0, R6 30 | MOVD R0, R7 31 | MOVD R0, R8 32 | MOVD trap+0(FP), R9 // syscall entry 33 | SYSCALL R9 34 | MOVD R3, r1+32(FP) 35 | MOVD R4, r2+40(FP) 36 | BL runtime·exitsyscall(SB) 37 | RET 38 | 39 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 40 | BR syscall·RawSyscall(SB) 41 | 42 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 43 | BR syscall·RawSyscall6(SB) 44 | 45 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 46 | MOVD a1+8(FP), R3 47 | MOVD a2+16(FP), R4 48 | MOVD a3+24(FP), R5 49 | MOVD R0, R6 50 | MOVD R0, R7 51 | MOVD R0, R8 52 | MOVD trap+0(FP), R9 // syscall entry 53 | SYSCALL R9 54 | MOVD R3, r1+32(FP) 55 | MOVD R4, r2+40(FP) 56 | RET 57 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_s390x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build s390x 6 | // +build linux 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for s390x, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | BR syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | BR syscall·Syscall6(SB) 23 | 24 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 25 | BL runtime·entersyscall(SB) 26 | MOVD a1+8(FP), R2 27 | MOVD a2+16(FP), R3 28 | MOVD a3+24(FP), R4 29 | MOVD $0, R5 30 | MOVD $0, R6 31 | MOVD $0, R7 32 | MOVD trap+0(FP), R1 // syscall entry 33 | SYSCALL 34 | MOVD R2, r1+32(FP) 35 | MOVD R3, r2+40(FP) 36 | BL runtime·exitsyscall(SB) 37 | RET 38 | 39 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 40 | BR syscall·RawSyscall(SB) 41 | 42 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 43 | BR syscall·RawSyscall6(SB) 44 | 45 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 46 | MOVD a1+8(FP), R2 47 | MOVD a2+16(FP), R3 48 | MOVD a3+24(FP), R4 49 | MOVD $0, R5 50 | MOVD $0, R6 51 | MOVD $0, R7 52 | MOVD trap+0(FP), R1 // syscall entry 53 | SYSCALL 54 | MOVD R2, r1+32(FP) 55 | MOVD R3, r2+40(FP) 56 | RET 57 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | ) 27 | 28 | // Socketoption Level 29 | const ( 30 | SOL_BLUETOOTH = 0x112 31 | SOL_HCI = 0x0 32 | SOL_L2CAP = 0x6 33 | SOL_RFCOMM = 0x12 34 | SOL_SCO = 0x11 35 | ) 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Darwin's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a Darwin device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev >> 24) & 0xff) 13 | } 14 | 15 | // Minor returns the minor component of a Darwin device number. 16 | func Minor(dev uint64) uint32 { 17 | return uint32(dev & 0xffffff) 18 | } 19 | 20 | // Mkdev returns a Darwin device number generated from the given major and minor 21 | // components. 22 | func Mkdev(major, minor uint32) uint64 { 23 | return (uint64(major) << 24) | uint64(minor) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Dragonfly's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a DragonFlyBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a DragonFlyBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a DragonFlyBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_freebsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in FreeBSD's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a FreeBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a FreeBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a FreeBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_netbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in NetBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a NetBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x000fff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of a NetBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xfff00000) >> 12) 19 | return minor 20 | } 21 | 22 | // Mkdev returns a NetBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x000fff00 26 | dev |= (uint64(minor) << 12) & 0xfff00000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in OpenBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of an OpenBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x0000ff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of an OpenBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xffff0000) >> 8) 19 | return minor 20 | } 21 | 22 | // Mkdev returns an OpenBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x0000ff00 26 | dev |= (uint64(minor) << 8) & 0xffff0000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dirent.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // ParseDirent parses up to max directory entries in buf, 12 | // appending the names to names. It returns the number of 13 | // bytes consumed from buf, the number of entries added 14 | // to names, and the new names slice. 15 | func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) { 16 | return syscall.ParseDirent(buf, max, names) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build ppc64 s390x mips mips64 6 | 7 | package unix 8 | 9 | const isBigEndian = true 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_little.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build 386 amd64 amd64p32 arm arm64 ppc64le mipsle mips64le 6 | 7 | package unix 8 | 9 | const isBigEndian = false 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | 29 | func Unsetenv(key string) error { 30 | return syscall.Unsetenv(key) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/flock.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 12 | // systems by flock_linux_32bit.go to be SYS_FCNTL64. 13 | var fcntl64Syscall uintptr = SYS_FCNTL 14 | 15 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 16 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 17 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 18 | if errno == 0 { 19 | return nil 20 | } 21 | return errno 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/flock_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 linux,arm linux,mips linux,mipsle 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,linux,amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/mksysnum_darwin.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # Copyright 2009 The Go Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style 4 | # license that can be found in the LICENSE file. 5 | # 6 | # Generate system call table for Darwin from sys/syscall.h 7 | 8 | use strict; 9 | 10 | if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") { 11 | print STDERR "GOARCH or GOOS not defined in environment\n"; 12 | exit 1; 13 | } 14 | 15 | my $command = "mksysnum_darwin.pl " . join(' ', @ARGV); 16 | 17 | print <){ 29 | if(/^#define\s+SYS_(\w+)\s+([0-9]+)/){ 30 | my $name = $1; 31 | my $num = $2; 32 | $name =~ y/a-z/A-Z/; 33 | print " SYS_$name = $num;" 34 | } 35 | } 36 | 37 | print <){ 30 | if(/^([0-9]+)\s+STD\s+({ \S+\s+(\w+).*)$/){ 31 | my $num = $1; 32 | my $proto = $2; 33 | my $name = "SYS_$3"; 34 | $name =~ y/a-z/A-Z/; 35 | 36 | # There are multiple entries for enosys and nosys, so comment them out. 37 | if($name =~ /^SYS_E?NOSYS$/){ 38 | $name = "// $name"; 39 | } 40 | if($name eq 'SYS_SYS_EXIT'){ 41 | $name = 'SYS_EXIT'; 42 | } 43 | 44 | print " $name = $num; // $proto\n"; 45 | } 46 | } 47 | 48 | print <){ 30 | if(/^([0-9]+)\s+\S+\s+STD\s+({ \S+\s+(\w+).*)$/){ 31 | my $num = $1; 32 | my $proto = $2; 33 | my $name = "SYS_$3"; 34 | $name =~ y/a-z/A-Z/; 35 | 36 | # There are multiple entries for enosys and nosys, so comment them out. 37 | if($name =~ /^SYS_E?NOSYS$/){ 38 | $name = "// $name"; 39 | } 40 | if($name eq 'SYS_SYS_EXIT'){ 41 | $name = 'SYS_EXIT'; 42 | } 43 | 44 | print " $name = $num; // $proto\n"; 45 | } 46 | } 47 | 48 | print <){ 30 | if(/^([0-9]+)\s+STD\s+(NOLOCK\s+)?({ \S+\s+\*?(\w+).*)$/){ 31 | my $num = $1; 32 | my $proto = $3; 33 | my $name = $4; 34 | $name =~ y/a-z/A-Z/; 35 | 36 | # There are multiple entries for enosys and nosys, so comment them out. 37 | if($name =~ /^SYS_E?NOSYS$/){ 38 | $name = "// $name"; 39 | } 40 | if($name eq 'SYS_SYS_EXIT'){ 41 | $name = 'SYS_EXIT'; 42 | } 43 | 44 | print " $name = $num; // $proto\n"; 45 | } 46 | } 47 | 48 | print <= 10 { 20 | buf[i] = byte(val%10 + '0') 21 | i-- 22 | val /= 10 23 | } 24 | buf[i] = byte(val + '0') 25 | return string(buf[i:]) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: sec, Nsec: nsec} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: sec, Usec: usec} 20 | } 21 | 22 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 23 | k.Ident = uint64(fd) 24 | k.Filter = int16(mode) 25 | k.Flags = uint16(flags) 26 | } 27 | 28 | func (iov *Iovec) SetLen(length int) { 29 | iov.Len = uint64(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetControllen(length int) { 33 | msghdr.Controllen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 41 | var writtenOut uint64 = 0 42 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 43 | 44 | written = int(writtenOut) 45 | 46 | if e1 != 0 { 47 | err = e1 48 | } 49 | return 50 | } 51 | 52 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: sec, Nsec: nsec} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: sec, Usec: usec} 20 | } 21 | 22 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 23 | k.Ident = uint64(fd) 24 | k.Filter = int16(mode) 25 | k.Flags = uint16(flags) 26 | } 27 | 28 | func (iov *Iovec) SetLen(length int) { 29 | iov.Len = uint64(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetControllen(length int) { 33 | msghdr.Controllen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 41 | var writtenOut uint64 = 0 42 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 43 | 44 | written = int(writtenOut) 45 | 46 | if e1 != 0 { 47 | err = e1 48 | } 49 | return 50 | } 51 | 52 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,linux 6 | // +build !gccgo 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | //go:noescape 13 | func gettimeofday(tv *Timeval) (err syscall.Errno) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func (iov *Iovec) SetLen(length int) { 18 | iov.Len = uint64(length) 19 | } 20 | 21 | func (cmsg *Cmsghdr) SetLen(length int) { 22 | cmsg.Len = uint32(length) 23 | } 24 | 25 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 26 | // TODO(aram): implement this, see issue 5847. 27 | panic("unimplemented") 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build !gccgo 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 13 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptracearm_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair(arm, arm64). DO NOT EDIT. 2 | 3 | // +build linux 4 | // +build arm arm64 5 | 6 | package unix 7 | 8 | import "unsafe" 9 | 10 | // PtraceRegsArm is the registers used by arm binaries. 11 | type PtraceRegsArm struct { 12 | Uregs [18]uint32 13 | } 14 | 15 | // PtraceGetRegsArm fetches the registers used by arm binaries. 16 | func PtraceGetRegsArm(pid int, regsout *PtraceRegsArm) error { 17 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 18 | } 19 | 20 | // PtraceSetRegsArm sets the registers used by arm binaries. 21 | func PtraceSetRegsArm(pid int, regs *PtraceRegsArm) error { 22 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 23 | } 24 | 25 | // PtraceRegsArm64 is the registers used by arm64 binaries. 26 | type PtraceRegsArm64 struct { 27 | Regs [31]uint64 28 | Sp uint64 29 | Pc uint64 30 | Pstate uint64 31 | } 32 | 33 | // PtraceGetRegsArm64 fetches the registers used by arm64 binaries. 34 | func PtraceGetRegsArm64(pid int, regsout *PtraceRegsArm64) error { 35 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 36 | } 37 | 38 | // PtraceSetRegsArm64 sets the registers used by arm64 binaries. 39 | func PtraceSetRegsArm64(pid int, regs *PtraceRegsArm64) error { 40 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 41 | } 42 | -------------------------------------------------------------------------------- /vendor/gomdb/README.md: -------------------------------------------------------------------------------- 1 | gomdb 2 | ===== 3 | 4 | Go wrapper for OpenLDAP Lightning Memory-Mapped Database (LMDB). 5 | Read more about LMDB here: http://symas.com/mdb/ 6 | 7 | GoDoc available here: http://godoc.org/github.com/szferi/gomdb 8 | 9 | Build 10 | ======= 11 | 12 | `go get github.com/szferi/gomdb` 13 | 14 | There is no dependency on LMDB dynamic library. 15 | 16 | On FreeBSD 10, you must explicitly set `CC` (otherwise it will fail with a cryptic error), for example: 17 | 18 | `CC=clang go test -v` 19 | 20 | TODO 21 | ====== 22 | 23 | * write more documentation 24 | * write more unit test 25 | * benchmark 26 | * figure out how can you write go binding for `MDB_comp_func` and `MDB_rel_func` 27 | * Handle go `*Cursor` close with `txn.Commit` and `txn.Abort` transparently 28 | 29 | -------------------------------------------------------------------------------- /vendor/gomdb/mdb.go: -------------------------------------------------------------------------------- 1 | // +build lmdb 2 | 3 | /* 4 | A thin wrapper for the lmdb C library. These are low-level bindings for the C 5 | API. The C documentation should be used as a reference while developing 6 | (http://symas.com/mdb/doc/group__mdb.html). 7 | 8 | Errors 9 | 10 | The errors returned by the package API will with few exceptions be of type 11 | Errno or syscall.Errno. The only errors of type Errno returned are those 12 | defined in lmdb.h. Other errno values like EINVAL will by of type 13 | syscall.Errno. 14 | */ 15 | package mdb 16 | -------------------------------------------------------------------------------- /vendor/gomdb/val.go: -------------------------------------------------------------------------------- 1 | // +build lmdb 2 | 3 | package mdb 4 | 5 | /* 6 | #cgo CFLAGS: -pthread -W -Wall -Wno-unused-parameter -Wbad-function-cast -O2 -g 7 | #cgo CFLAGS: -I/usr/local 8 | 9 | #include 10 | #include 11 | #include "lmdb.h" 12 | */ 13 | import "C" 14 | 15 | import ( 16 | "reflect" 17 | "unsafe" 18 | ) 19 | 20 | // MDB_val 21 | type Val C.MDB_val 22 | 23 | // Create a Val that points to p's data. the Val's data must not be freed 24 | // manually and C references must not survive the garbage collection of p (and 25 | // the returned Val). 26 | func Wrap(p []byte) Val { 27 | if len(p) == 0 { 28 | return Val(C.MDB_val{}) 29 | } 30 | return Val(C.MDB_val{ 31 | mv_size: C.size_t(len(p)), 32 | mv_data: unsafe.Pointer(&p[0]), 33 | }) 34 | } 35 | 36 | // If val is nil, a empty slice is retured. 37 | func (val Val) Bytes() []byte { 38 | return C.GoBytes(val.mv_data, C.int(val.mv_size)) 39 | } 40 | 41 | // If val is nil, a empty slice is retured. 42 | func (val Val) BytesNoCopy() []byte { 43 | hdr := reflect.SliceHeader{ 44 | Data: uintptr(unsafe.Pointer(val.mv_data)), 45 | Len: int(val.mv_size), 46 | Cap: int(val.mv_size), 47 | } 48 | return *(*[]byte)(unsafe.Pointer(&hdr)) 49 | } 50 | 51 | // If val is nil, an empty string is returned. 52 | func (val Val) String() string { 53 | return C.GoStringN((*C.char)(val.mv_data), C.int(val.mv_size)) 54 | } 55 | -------------------------------------------------------------------------------- /vendor/gopkg.in/ini.v1/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: build test bench vet 2 | 3 | build: vet bench 4 | 5 | test: 6 | go test -v -cover -race 7 | 8 | bench: 9 | go test -v -cover -race -test.bench=. -test.benchmem 10 | 11 | vet: 12 | go vet 13 | -------------------------------------------------------------------------------- /vendor/gopkg.in/macaron.v1/macaronlogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/vendor/gopkg.in/macaron.v1/macaronlogo.png -------------------------------------------------------------------------------- /views/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/views/.DS_Store -------------------------------------------------------------------------------- /views/crm/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/views/crm/.DS_Store -------------------------------------------------------------------------------- /views/crm/comm/script.html: -------------------------------------------------------------------------------- 1 | {{define "crm_script"}} 2 | 3 | 4 | 5 | 6 | 7 | 8 | {{end}} -------------------------------------------------------------------------------- /views/crm/order/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/views/crm/order/.DS_Store -------------------------------------------------------------------------------- /views/crm/product/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/views/crm/product/.DS_Store -------------------------------------------------------------------------------- /views/pos/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/views/pos/.DS_Store -------------------------------------------------------------------------------- /views/pos/print.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /views/report/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/views/report/.DS_Store -------------------------------------------------------------------------------- /views/user/printsetting.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jicg/easypos-old/a8d68db3110efbe40b17b789514cea17530b72df/views/user/printsetting.html --------------------------------------------------------------------------------