• Stars
    star
    190
  • Rank 203,711 (Top 5 %)
  • Language
    Go
  • License
    MIT License
  • Created over 8 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿ‘€ Rizla builds, runs and monitors your Go Applications with ease. See https://github.com/kataras/iris-cli for Iris users.

Rizla builds, runs and monitors your Go Applications with ease.

Travis Widget Release Widget Report Widget License Widget Chat Widget

Installation

The only requirement is the Go Programming Language, at least 1.7.

$ go get -u github.com/kataras/rizla

Getting Started

$ rizla main.go #single project monitoring
$ rizla C:/myprojects/project1/main.go C:/myprojects/project2/main.go #multi projects monitoring
$ rizla -walk main.go #prepend '-walk' only when the default file changes scanning method doesn't works for you.
$ rizla -delay=5s main.go # if delay > 0 then it delays the reload, also note that it accepts the first change but the rest of changes every "delay".

Want to use it from your project's source code? easy

$ cat from_code_simple.go
package main

import (
    "github.com/kataras/rizla/rizla"
)

func main() {
  // Build, run & start monitoring the projects
  rizla.Run("C:/iris-project/main.go", "C:/otherproject/main.go")
  // watcher, _ := rizla.WatcherFromFlag("-walk")
  // rizla.RunWith(watcher, "./main.go", 0)
}
$ cat from_code_pro.go
package main

import (
    "path/filepath"
    "runtime"
    "time"
    "os"

    "github.com/kataras/rizla/rizla"
)

func main() {
  // Create a new project by the main source file
  project := rizla.NewProject("C:/myproject/main.go")

  // The below are optional

  // Optionally, change the out for info logs and error messages.
  project.Out.SetOutput(os.Stdout)
  project.Err.SetOutput(os.Stderr)

  project.Name = "My super project"
  // Allow reload every 3 seconds or more no less
  project.AllowReloadAfter = time.Duration(3) * time.Second
  // Custom subdirectory matcher, for the watcher, return true to include this folder to the watcher
  // the default is:
  project.Watcher = func(absolutePath string) bool {
        base := filepath.Base(abs)
        return !(base == ".git" || base == "node_modules" || base == "vendor")
  }
  // Custom file matcher on runtime (file change), return true to reload when a file with this file name changed
  // the default is:
  project.Matcher = func(filename string) bool {
        isWindows = runtime.GOOS == "windows"
        goExt     = ".go"
        return (filepath.Ext(fullname) == goExt) ||
        (!isWindows && strings.Contains(fullname, goExt))
  }
  // Add arguments, these will be used from the executable file
  project.Args = []string{"-myargument","the value","-otherargument","a value"}
  // Custom callback before reload, the default is:
  project.OnReload = func(string) {
        fromproject := ""
        if p.Name != "" {
            fromproject = "From project '" + project.Name + "': "
        }
        project.Out.Infof("%sA change has been detected, reloading now...", fromproject)
   }
   // Custom callback after reload, the default is:
   project.OnReloaded = func(string) {
        
   }

  // End of optional

  // Add the project to the rizla container
  rizla.Add(project)
  //  Build, run & start monitoring the project(s)
  rizla.Run(nil)
}

That's all!

FAQ

Ask questions and get real-time answers from the Chat.

Features

  • Super easy - is created for everyone.
  • You can use it either as command line tool either as part of your project's source code!
  • Multi-Monitoring - Supports monitoring of unlimited projects.
  • Rizla, by-default, uses the operating system's signals to fire a change because it is the fastest way and it consumes the minimal CPU.
    • You 're still able to change the watcher to use the filepath.Walk too with -walk flag.
  • delay reload on detect change with -delay

People


If you'd like to discuss this package, or ask questions about it, feel free to Chat.

The author of rizla is @kataras.

Versioning

Current: v0.1.1

HISTORY file is your best friend!

Read more about Semantic Versioning 2.0.0

Todo

  • Tests
  • Provide full examples.

Third-Party Licenses

Third-Party Licenses can be found here

License

This project is licensed under the MIT License.

License can be found here.

More Repositories

1

iris

The fastest HTTP/2 Go Web Framework. New, modern and easy to learn. Fast development with Code you control. Unbeatable cost-performance ratio ๐Ÿš€
Go
24,911
star
2

neffos

A modern, fast and scalable websocket framework with elegant API written in Go
Go
563
star
3

golog

A high-performant Logging Foundation for Go Applications. X3 faster than the rest leveled loggers.
Go
321
star
4

muxie

Muxie is a modern, fast and light HTTP multiplexer for Go. Fully compatible with the http.Handler interface. Written for everyone.
Go
283
star
5

go-sessions

๐Ÿ” The sessions manager for the Go Programming Language. Supports both net/http and fasthttp.
Go
207
star
6

jwt

A fast and simple JWT implementation for Go
Go
194
star
7

iris-cli

[WIP] Iris Command Line Interface
Go
118
star
8

i18n

๐Ÿ†• High-performant and powerful localization and internationalization support for Go
Go
108
star
9

go-events

๐Ÿ“ฃ Pure nodejs EventEmmiter for the Go Programming Language.
Go
96
star
10

server-benchmarks

๐Ÿš€ Cross-platform transparent benchmarks for HTTP/2 Web Servers at 2020-2024
Go
89
star
11

blocks

Go-idiomatic View Engine
Go
70
star
12

go-websocket

๐Ÿ”ˆ Deprecated. Use https://github.com/kataras/neffos instead
Go
59
star
13

go-template

๐Ÿ”ˆ Deprecated. Use https://github.com/kataras/iris/wiki/View instead
Go
56
star
14

versioning

๐Ÿ†• API Versioning for Go
Go
51
star
15

build-a-better-web-together

Deprecated. Moved to https://github.com/kataras/iris/wiki and https://docs.iris-go.com
CSS
48
star
16

httpcache

ABANDONED: Use https://github.com/kataras/iris instead. Extremely-easy cache service for HTTP/x . Supports both net/http and valyala/fasthttp
Go
43
star
17

neffos.js

Node.js and Browser support for the neffos real-time framework written in Typescript.
TypeScript
39
star
18

hcaptcha

hCaptcha HTTP middleware for Go web servers
Go
32
star
19

pg

PG is a Go library that simplifies PostgreSQL database interaction with struct-based entities, schema management, and repository pattern.
Go
28
star
20

tunnel

Public URLs for exposing your local web server
Go
26
star
21

go-fs

๐Ÿ“ Provides some common utilities which GoLang developers use when working with files, either system files or web files.
Go
26
star
22

rewrite

The rewrite middleware for Go. Perfect for SEO
Go
22
star
23

httpfs

Flexible and easy to use HTTP File Server for Go
Go
20
star
24

pio

Low-level package that provides an easy way to centralize different output targets. Supports colors and text decoration to all popular terminals
Go
20
star
25

sitemap

๐Ÿ†• Sitemap Protocol for Go | https://support.google.com/webmasters/answer/189077?hl=en
Go
19
star
26

go-errors

โš ๏ธ Better GoLang error handling.
Go
18
star
27

compress

HTTP Compression for Go
Go
16
star
28

go-serializer

โžฟ Serialize any custom type or convert any content to []byte or string, for Go Programming Language
Go
16
star
29

chronos

NEW: Chronos provides an easy way to limit X operations per Y time in accuracy of nanoseconds
Go
14
star
30

basicauth

The most advanced and powerful Go HTTP Basic Authentication middleware.
Go
13
star
31

gitbook-to-wiki

Export your GitBook as a GitHub Wiki or Docsify pages.
Go
13
star
32

sheets

๐Ÿ“Š (Unofficial) A Lightweight Google Spreadsheets Client written in Go
Go
12
star
33

vscode-iris

Iris Web Framework snippets for Visual Studio Code
TypeScript
9
star
34

realip

Extract the real HTTP client's Remote IP Address
Go
8
star
35

methodoverride

๐Ÿ†• Lets you use HTTP verbs such as PUT or DELETE in places where the client doesn't support it
Go
8
star
36

trie-examples-to-remember-again

A place to keep my coding examples for different kind of trie usage in order to remember them again - this time on github
Go
7
star
37

requestid

Unique Identifier for each HTTP request
Go
6
star
38

go-options

๐Ÿ“ฆ Clean APIs for your Go Applications
Go
5
star
39

httpclient

HTTP/2 Client for Go Programming Language #golang #http
Go
4
star
40

mail

Mail is a ridiculous simple email sender written in Go
Go
4
star
41

pkg

Public Repository of the common packages that Gerasimos Maropoulos, the author of Iris, uses for various commercial or non-commercial projects.
Go
4
star
42

pgx-golog

pgx and golog integration
Go
3
star
43

ultrasecurity

10 seconds post-login OS security
Go
1
star
44

kataras

Gerasimos Maropoulos
1
star