Before we go further, let’s we see how the different between OAS 2.0 and OAS 3.0 on this documentation :
OAS 2.0: https://swagger.io/docs/specification/2-0/api-host-and-base-path/OAS 3.0: https://swagger.io/docs/specification/api-host-and-base-path/
Then, I found interesting discussion on reddit forum about generate open api 3.0 for Go:
connection() : auth error: sasl conversation error: unable to authenticate using mechanism “SCRAM-SHA-1”: (AuthenticationFailed) Authentication failed.
I was tried to connect with mongo db with simple connection with mongo-go-driver. Here the code main.go
:
package mainimport (
"context"
"fmt"
"net/url""go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
"go.mongodb.org/mongo-driver/mongo/readpref"
)var ctx = context.Background()func main() {
driver := "mongodb"
host := "127.0.0.1"
port := "27017"
username := "kecci"
password := "p@sword%20"URL := url.URL{
Scheme: driver,
Host: fmt.Sprintf("%s:%s", host, port),
}if username != "" || password != "" {
URL.User = url.UserPassword(username, password)
}fmt.Printf("URI: %s \n", URL.String())
clientOptions := options.Client().ApplyURI(URL.String())
clientOptions.SetDirect(true)client…
Kok ada dua rumah yang luas tanah-nya sama tapi harga-nya berbeda ?
Padahal sama-sama luas tanah 60 meter. Yang satu 300 juta dan yang satu lagi 1,3 miliar. Wow, sangat signifikan perbedaannya hingga 1 miliar.
Sebelumnya, saya ingin katakan. Tulisan ini hanya dari sudut pandang pribadi. Hanya untuk sharing tentang apa yang telah saya alami.
Nilai properti tergantung pada 4 faktor, yaitu:
What Webhook is and how to implement the Webhook properly.
Before we go further, let’s we read about hook.
In computer programming, the term hooking covers a range of techniques used to alter or augment the behaviour of an operating system, of applications, or of other software components by intercepting function calls or messages or events passed between software components. Code that handles such intercepted function calls, events or messages is called a hook. — Wikipedia
So what is webhook.
A webhook in web development is a method of augmenting or altering the behavior of a web page or web…
Panic is a built-in function that stops the ordinary flow of control and begins panicking. — blog.golang.org
Panic.
I was scary to hear that. It’s sounds like terrible crash. But If you using golang, as we all know, there is no exception in Go. Just Panic.
Example of panic runtime slice bounds out of range :
package mainimport (
"fmt"
)func main() {
h := "Hello"
substring := h[0:6] // Here is the panic
fmt.Println(substring)
}
Output :
panic: runtime error: slice bounds out of range [:6] with length 5
goroutine 1 [running]:
main.main()
/tmp/sandbox094013890/prog.go:9 +0x1d
So what…
Kunci pembangunan aplikasi yaitu salah satunya adalah dokumentasi yang baik. UML Diagram dapat menggambarkan kerangka kerja secara keseluruhan dengan baik.
Sebenarnya Ada beberapa macam dari UML diagram, namun menurut pengamatan saya, yang paling sering digunakan dalam pengembangan aplikasi ada 4 UML Diagram, yaitu sebagai berikut:
In performance scenario, as client, they want to know how long process time form the server. So the server should have tracker to show server process time information.
There are several information, such as database read, application process, cache read, file read, total duration. Read more HTTP Server-Timing: https://www.w3.org/TR/server-timing/
What I’m doing now, I was looking from echo framework to show server-time, but I there is no feature middleware to record server-time.
Finally, I found this library called mitchellh/go-server-timing
. It is simple and lightweight use to record and tracking metric of Server-Timing.
mitchellh/go-server-timing is Go (golang) library for creating…
Java, Spring boot, RESTful, H2 Database, Swagger, Heroku
There are 5 step to accomplish this project:
Initialize your project with Spring Initializr A Spring Initializr. Open: https://start.spring.io/
Add Dependency through Spring Initializr:
Software Engineer