Categorygithub.com/altid/libs
modulepackage
0.4.12
Repository: https://github.com/altid/libs.git
Documentation: pkg.go.dev

# README

Libs

This is a collection of libraries used to create Altid services and clients in a canonical way.

Overview

GoDoc Go Report Card License

How To Get

If you have a working Go toolchain, simply issue the following

go get -u github.com/altid/libs

Build Status

  • Auth passing badge
  • Markup passing badge
  • Html passing badge
  • Service passing badge
  • Store passing badge
  • Config passing badge

# Packages

Package config allows Altid services to interact withe the ndb-formatted configuration files used by Altid go get github.com/altid/libs/config The ndb format is described in http://man.cat-v.org/plan_9/6/ndb # Usage A service can marshall values to a struct through Marshall, as long as the entries follow these rules: - Nested structs will be ignored - Type must be bool, int, string, or one of Auth, Log, or ListenAddress - structs must have default values set Example: // package mypackage import ( "flag" "log" "os" "os/user" "github.com/altid/libs/config" "github.com/altid/libs/config/types" ) var conf = flag.Bool("conf", false, "Create configuration file") func main() { flag.Parse() u, _ := user.Current mytype := struct { // Struct tags are used by Create to interactively fill in any missing data Name string `Enter a name to use on the service` UseTLS bool `Use TLS? (true|false)` Port int Auth types.Auth `Enter the authentication method you would like to use: password|factotum|none` Logdir types.Logdir ListenAddress config.ListenAddress }{u.Name, false, 564, "none", "", ""} if flag.Lookup("conf") != nil { if e := config.Marshall(&mytype, "myservice", false); e != nil { log.Fatal(e) } os.Exit(0) } // Your error message should indicate that the user re-runs with -conf to create any missing entries if e := config.Marshall(&mytype, "myservice", false); e != nil { log.Fatal("unable to create config: %v\nRun program with -conf to create missing entries") } // [...] } */.
Package html helper library for parsing HTML for Altid markup.
Package markup implements an API for escaping markup elements in raw text input.
No description provided by the author