All of the following information is based on go version go1.17.1 darwin/amd64
.
GOOS | Out of the Box |
---|---|
aix |
✅ |
android |
✅ |
package main | |
import ( | |
"fmt" | |
"time" | |
"github.com/jeffotoni/gocache" | |
) | |
func main() { |
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
) | |
func Hello(w http.ResponseWriter, r *http.Request) { | |
w.WriteHeader(http.StatusOK) |
dockerfile ◀◀ buffers | |
# Start by building the application. | |
FROM golang:1.10 as build | |
WORKDIR /go/src/app |
// exemplo mapa generico | |
package main | |
import ( | |
"fmt" | |
"reflect" | |
) | |
func main() { |
// Resources: | |
// https://github.com/diafygi/webcrypto-examples | |
// https://developer.mozilla.org/en-US/docs/Web/API/CryptoKey | |
// http://blog.engelke.com/tag/webcrypto/ | |
// Tested in Firefox | |
function ArrayToBuffer(str) { | |
var buf = new ArrayBuffer(str.length * 2); | |
var bufView = new Uint16Array(buf); | |
for (var i = 0, strLen = str.length; i < strLen; i++) { |
/** | |
* @autor [email protected] | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <dlfcn.h> | |
int main() | |
{ | |
<input type='file' accept='*' onchange='openFile(event)'><br> | |
<textarea id='output' rows=9 cols=35></textarea> | |
<script> | |
var openFile = function(event) { | |
var output = document.getElementById('output'); | |
var input = event.target; |
<?php | |
print "<h1>PHP Encryption with libsodium</h1>"; | |
$message = "This text is secret"; | |
$ciphertext = cryptor::encrypt("password", $message); | |
$plaintext = cryptor::decrypt("password", $ciphertext); | |
print "Message:<br />$message <br /><br />Ciphertext:<br />$ciphertext<br /><br />Plaintext:<br />$plaintext"; |
Responding to requests via simple route matching is built in to Go's net/http
standard library package. Just register the path prefixes and callbacks you want invoked and then call the ListenAndServe
to have the default request handler invoked on each request. For example:
package main
import (