holmeszyx / analyse-gen-go

Generating thirdpart Analyse SDK source code for events with a `toml` definition file.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generating Analyse SDK source code for events with a toml definition file.

Usage

  1. build cmd binary
go build -o als-gen cmd/*.go
  1. writing the events definition file by toml. like testdata/als.toml

  2. Executing

# in cmd dir

als-gen -c ../testdata/als.toml -t ../testdata/umeng-android-kt.tmpl -out-base-dir ../testdata  -o St.kt -use-pkg=1

Template

Template funcs:

  • firstCap

    coverting first letter as upper case.

  • toFuncName

    Ouput string as Camel-Case

  • safeHan

    Filtering chars which are no "number", "chinese" or one mark in "_-.+". And replace the filtered char with "_"。 It is useful when export reporting events table.(Like Umeng event batch exporting template)

About

Generating thirdpart Analyse SDK source code for events with a `toml` definition file.


Languages

Language:Go 100.0%