m3o.dev

module
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2023 License: Apache-2.0

README

M3O License

Serverless Micro Services

Overview

M3O transforms public APIs into smaller easier to use Micro services which you can explore, discover and consume as serverless building blocks. The platform generates unified api docs, client libraries and examples using protobuf to OpenAPI conversion and some custom tools.

Features

Here are the main features:

  • 1️⃣ ONE Platform - Discover, explore and consume public APIs all in one place.
  • ☝️ ONE Account - Manage your API usage with one account and one token.
  • ⚡ ONE Framework - Learn, develop and integrate using one set of docs and libraries.

Services

Here are a few APIs:

  • Apps - Serverless app deployment
  • Cache - In-memory data storage
  • Database - Serverless postgres database
  • Events - Push event notifications
  • Users - Account management and authentication
  • Space - Infinite cloud storage

Getting Started

  • Head to m3o.com and signup for a free account.
  • Browse services on the Explore page.
  • Call any service using your token in the Authorization: Bearer [Token] header
  • All services are available through one API endpoint: https://api.m3o.com/v1/*.
  • Use m3o-cli, m3o-js and m3o-go clients for development

Quick Start

Grab your API token from the dashboard and export it

export M3O_API_TOKEN=xxxxxxx
Curl
curl "https://api.m3o.com/v1/db/Create" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $M3O_API_TOKEN" \
  -d '{
    "table": "notes",
    "record": {
      "name": "TODO",
      "list": ["eat", "sleep", "repeat"]
    }
  }'

Find all the curl examples in m3o-sh

Go

Import packages from go.m3o.com

import (
        "go.m3o.com"
        "go.m3o.com/db"
)

Create a new client with your API token and call it

client := m3o.New(os.Getenv("M3O_API_TOKEN"))
rsp, err := client.Db.Create(&db.CreateRequest{
        Table: "notes",
        Record: map[string]interface{}{
                 "name": "TODO",
                 "list": []string{"eat", "sleep", "repeat"},
        },
})
fmt.Println(rsp, err)

Find all the Go examples in m3o-go

JS

Install the m3o package

npm install m3o

Call app run like so

const m3o = require("m3o").default(process.env.M3O_API_TOKEN);

async function main() {
  let rsp = await m3o.db.create({
    table: "notes",
    record: {
      "name": "TODO",
      "list": ["eat", "sleep", "repeat"]
    }
  });
  console.log(rsp);
}

main();

Find more JS examples in m3o-js

CLI

Install the cli

curl -fssl https://install.m3o.com/cli | /bin/bash

Example call

m3o db create --table=notes --record='{"name": "TODO", "list": ["eat", "sleep", "repeat"]}'

See the m3o-cli for examples

Deployment

  1. See Cloud for Infrastructure deployment
  2. See Platform for Micro deployment
  3. See API for Backend deployment
  4. See Web for Web deployment

Directories

Path Synopsis
api module
admin command
alerts command
alerts/proto/fakes
Code generated by counterfeiter.
Code generated by counterfeiter.
balance command
balance/proto/fakes
Code generated by counterfeiter.
Code generated by counterfeiter.
billing command
billing/proto/fakes
Code generated by counterfeiter.
Code generated by counterfeiter.
customers command
customers/proto/fakes
Code generated by counterfeiter.
Code generated by counterfeiter.
emails command
emails/proto/fakes
Code generated by counterfeiter.
Code generated by counterfeiter.
endtoend command
endtoend/proto/fakes
Code generated by counterfeiter.
Code generated by counterfeiter.
internal/test/fakes
Code generated by counterfeiter.
Code generated by counterfeiter.
mixpanel command
oauth command
projects command
publicapi command
publicapi/proto/fakes
Code generated by counterfeiter.
Code generated by counterfeiter.
signup command
status command
stripe command
stripe/proto/fakes
Code generated by counterfeiter.
Code generated by counterfeiter.
usage command
usage/proto/fakes
Code generated by counterfeiter.
Code generated by counterfeiter.
v1 command
v1/handler
// Copyright 2020 Asim Aslam // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License.
// Copyright 2020 Asim Aslam // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License.
v1/proto/fakes
Code generated by counterfeiter.
Code generated by counterfeiter.
client module
apps
home module
cmd
cli
Package cli is a command line interface
Package cli is a command line interface
cli/gen
Package gen provides the micro gen command which simply runs go generate
Package gen provides the micro gen command which simply runs go generate
cli/init
Package init provides the micro init command for initialising plugins and imports
Package init provides the micro init command for initialising plugins and imports
cli/new
Package new generates micro service templates
Package new generates micro service templates
cli/run
Package runtime is the micro runtime
Package runtime is the micro runtime
cli/shutdown
Package shutdown will issue a shutdown signal
Package shutdown will issue a shutdown signal
cli/store
Package cli implements the `micro store` subcommands for example:
Package cli implements the `micro store` subcommands for example:
cli/token
Package token contains CLI client token related helpers tToken files consist of one line per token, each token having the structure of `micro://envAddress/namespace[/id]:token`, ie.
Package token contains CLI client token related helpers tToken files consist of one line per token, each token having the structure of `micro://envAddress/namespace[/id]:token`, ie.
cli/user
Package user handles the user cli command
Package user handles the user cli command
cli/util
Package cliutil contains methods used across all cli commands @todo: get rid of os.Exits and use errors instread
Package cliutil contains methods used across all cli commands @todo: get rid of os.Exits and use errors instread
cmd
cmd/protoc-gen-m3o command
protoc-gen-m3o is a plugin for the Google protocol buffer compiler to generate Go code.
protoc-gen-m3o is a plugin for the Google protocol buffer compiler to generate Go code.
cmd/protoc-gen-m3o/generator
The code generator for the plugin for the Google protocol buffer compiler.
The code generator for the plugin for the Google protocol buffer compiler.
plugin/etcd
Package etcd provides an etcd service registry
Package etcd provides an etcd service registry
plugin/postgres
Package postgres implements the postgres store
Package postgres implements the postgres store
profile
Package profile is for specific profiles @todo this package is the definition of cruft and should be rewritten in a more elegant way
Package profile is for specific profiles @todo this package is the definition of cruft and should be rewritten in a more elegant way
server
Package server is the micro server which runs the whole system
Package server is the micro server which runs the whole system
service/api/handler
Package handler provides http handlers
Package handler provides http handlers
service/api/handler/api
Package api provides an http-rpc handler which provides the entire http request over rpc
Package api provides an http-rpc handler which provides the entire http request over rpc
service/api/handler/event
Package event provides a handler which publishes an event
Package event provides a handler which publishes an event
service/api/handler/http
Package http is a http reverse proxy handler
Package http is a http reverse proxy handler
service/api/handler/rpc
Package rpc is a go-micro rpc handler.
Package rpc is a go-micro rpc handler.
service/api/handler/web
Package web contains the web handler including websocket support
Package web contains the web handler including websocket support
service/api/resolver
Package resolver resolves a http request to an endpoint
Package resolver resolves a http request to an endpoint
service/api/resolver/grpc
Package grpc resolves a grpc service like /greeter.Say/Hello to greeter service
Package grpc resolves a grpc service like /greeter.Say/Hello to greeter service
service/api/resolver/host
Package host resolves using http host
Package host resolves using http host
service/api/resolver/path
Package path resolves using http path
Package path resolves using http path
service/api/resolver/subdomain
Package subdomain is a resolver which uses the subdomain to determine the domain to route to.
Package subdomain is a resolver which uses the subdomain to determine the domain to route to.
service/api/resolver/vpath
Package vpath resolves using http path and recognised versioned urls
Package vpath resolves using http path and recognised versioned urls
service/api/router
Package router provides api service routing
Package router provides api service routing
service/api/router/registry
Package registry provides a dynamic api service router
Package registry provides a dynamic api service router
service/api/server/http
Package http provides a http server with features; acme, cors, etc
Package http provides a http server with features; acme, cors, etc
service/auth/jwt
Package jwt is a jwt implementation of the auth interface
Package jwt is a jwt implementation of the auth interface
service/broker
Package broker is the micro broker
Package broker is the micro broker
service/broker/memory
Package memory provides a memory broker
Package memory provides a memory broker
service/build/util/tar
Package tar is a wrapper around archive/tar, it's used for archiving and unarchiving source from and into folders on the host.
Package tar is a wrapper around archive/tar, it's used for archiving and unarchiving source from and into folders on the host.
service/build/util/zip
Package zip is a wrapper around archive/zip, it's used for archiving and unarchiving source from and into folders on the host.
Package zip is a wrapper around archive/zip, it's used for archiving and unarchiving source from and into folders on the host.
service/client
Package client is an interface for an RPC client
Package client is an interface for an RPC client
service/client/grpc
Package grpc provides a gRPC client
Package grpc provides a gRPC client
service/client/mucp
Package mucp provides a transport agnostic RPC client
Package mucp provides a transport agnostic RPC client
service/config
Package config is an interface for dynamic configuration.
Package config is an interface for dynamic configuration.
service/config/env
Package env provides config from environment variables
Package env provides config from environment variables
service/context
Package context provides a context for accessing services
Package context provides a context for accessing services
service/context/metadata
Package metadata is a way of defining message headers
Package metadata is a way of defining message headers
service/debug/handler
Package handler implements service debug handler embedded in go-micro services
Package handler implements service debug handler embedded in go-micro services
service/debug/log
Package log provides debug logging
Package log provides debug logging
service/debug/log/kubernetes
Package kubernetes is a logger implementing (github.com/micro/go-micro/v3/debug/log).Log
Package kubernetes is a logger implementing (github.com/micro/go-micro/v3/debug/log).Log
service/debug/log/memory
Package memory provides an in memory log buffer
Package memory provides an in memory log buffer
service/debug/profile
Package profile is for profilers
Package profile is for profilers
service/debug/profile/http
Package http enables the http profiler
Package http enables the http profiler
service/debug/profile/pprof
Package pprof provides a pprof profiler which writes output to /tmp/[name].{cpu,mem}.pprof
Package pprof provides a pprof profiler which writes output to /tmp/[name].{cpu,mem}.pprof
service/debug/stats
Package stats provides runtime stats
Package stats provides runtime stats
service/debug/trace
Package trace provides an interface for distributed tracing
Package trace provides an interface for distributed tracing
service/errors
Package errors provides a way to return detailed information for an RPC request error.
Package errors provides a way to return detailed information for an RPC request error.
service/events
Package events is for event streaming and storage
Package events is for event streaming and storage
service/logger
Package log provides a log interface
Package log provides a log interface
service/metrics
Package metrics is for instrumentation and debugging
Package metrics is for instrumentation and debugging
service/model
Package model implements convenience methods for managing indexes on top of the Store.
Package model implements convenience methods for managing indexes on top of the Store.
service/model/sql
Package sql is for a sql database model
Package sql is for a sql database model
service/network
Package network implements micro network node
Package network implements micro network node
service/network/resolver
Package resolver resolves network names to addresses
Package resolver resolves network names to addresses
service/network/resolver/dns
Package dns resolves names to dns records
Package dns resolves names to dns records
service/network/resolver/dnssrv
Package dns srv resolves names to dns srv records
Package dns srv resolves names to dns srv records
service/network/resolver/http
Package http resolves names to network addresses using a http request
Package http resolves names to network addresses using a http request
service/network/resolver/noop
Package noop is a noop resolver
Package noop is a noop resolver
service/network/resolver/registry
Package registry resolves names using the go-micro registry
Package registry resolves names using the go-micro registry
service/network/resolver/static
Package static is a static resolver
Package static is a static resolver
service/network/transport
Package transport is an interface for synchronous connection based communication
Package transport is an interface for synchronous connection based communication
service/network/transport/memory
Package memory is an in-memory transport
Package memory is an in-memory transport
service/network/tunnel
Package tunnel provides gre network tunnelling
Package tunnel provides gre network tunnelling
service/network/tunnel/broker
Package broker is a tunnel broker
Package broker is a tunnel broker
service/network/tunnel/transport
Package transport provides a tunnel transport
Package transport provides a tunnel transport
service/proxy
Package proxy is a transparent proxy built on the go-micro/server
Package proxy is a transparent proxy built on the go-micro/server
service/proxy/grpc
Package grpc is a grpc proxy built for the go-micro/server
Package grpc is a grpc proxy built for the go-micro/server
service/proxy/http
Package http provides a micro rpc to http proxy
Package http provides a micro rpc to http proxy
service/proxy/mucp
Package mucp transparently forwards the incoming request using a go-micro client.
Package mucp transparently forwards the incoming request using a go-micro client.
service/registry
Package registry is the micro registry
Package registry is the micro registry
service/registry/cache
Package cache provides a registry cache
Package cache provides a registry cache
service/registry/memory
Package memory provides an in-memory registry
Package memory provides an in-memory registry
service/registry/noop
Package noop is a registry which does nothing
Package noop is a registry which does nothing
service/router/kubernetes
Package kubernetes is a kubernetes router which uses the service name and network to route
Package kubernetes is a kubernetes router which uses the service name and network to route
service/runtime
Package runtime is a service runtime manager
Package runtime is a service runtime manager
service/runtime/kubernetes
Package kubernetes implements kubernetes micro runtime
Package kubernetes implements kubernetes micro runtime
service/runtime/kubernetes/client
Package client provides an implementation of a restricted subset of kubernetes API client
Package client provides an implementation of a restricted subset of kubernetes API client
service/runtime/local/process
Package process executes a binary
Package process executes a binary
service/runtime/local/process/os
Package os runs processes locally
Package os runs processes locally
service/runtime/local/test/bar command
Package main is used to test the local runtime, specifically the entrypoint function
Package main is used to test the local runtime, specifically the entrypoint function
service/runtime/local/test/foo/cmd/bar command
Package main is used to test the local runtime, specifically the entrypoint function
Package main is used to test the local runtime, specifically the entrypoint function
service/runtime/local/test/foo/cmd/baz command
Package main is used to test the local runtime, specifically the entrypoint function
Package main is used to test the local runtime, specifically the entrypoint function
service/runtime/local/test/qux/cmd/test command
Package main is used to test the local runtime, specifically the entrypoint function
Package main is used to test the local runtime, specifically the entrypoint function
service/runtime/source
Package source retrieves source code
Package source retrieves source code
service/runtime/source/go
Package golang is a source for Go
Package golang is a source for Go
service/server/grpc
Package grpc provides a grpc server
Package grpc provides a grpc server
service/server/mucp
Package mucp provides a transport agnostic RPC server
Package mucp provides a transport agnostic RPC server
service/store
Package store is an interface for distributed data storage.
Package store is an interface for distributed data storage.
service/store/file
Package local is a file system backed store
Package local is a file system backed store
service/store/memory
Package memory is a in-memory store store
Package memory is a in-memory store store
test/fakes
Code generated by counterfeiter.
Code generated by counterfeiter.
util/acme
Package acme abstracts away various ACME libraries
Package acme abstracts away various ACME libraries
util/acme/autocert
Package autocert is the ACME provider from golang.org/x/crypto/acme/autocert This provider does not take any config.
Package autocert is the ACME provider from golang.org/x/crypto/acme/autocert This provider does not take any config.
util/acme/certmagic
Package certmagic is the ACME provider from github.com/caddyserver/certmagic
Package certmagic is the ACME provider from github.com/caddyserver/certmagic
util/backoff
Package backoff provides backoff functionality
Package backoff provides backoff functionality
util/codec
Package codec is an interface for encoding messages
Package codec is an interface for encoding messages
util/codec/bytes
Package bytes provides a bytes codec which does not encode or decode anything
Package bytes provides a bytes codec which does not encode or decode anything
util/codec/grpc
Package grpc provides a grpc codec
Package grpc provides a grpc codec
util/codec/json
Package json provides a json codec
Package json provides a json codec
util/codec/jsonrpc
Package jsonrpc provides a json-rpc 1.0 codec
Package jsonrpc provides a json-rpc 1.0 codec
util/codec/proto
Package proto provides a proto codec
Package proto provides a proto codec
util/codec/protorpc
Protorpc provides a net/rpc proto-rpc codec.
Protorpc provides a net/rpc proto-rpc codec.
util/codec/text
Package text reads any text/* content-type
Package text reads any text/* content-type
util/config
Package config contains helper methods for client side config management (`~/.micro/config.json` file).
Package config contains helper methods for client side config management (`~/.micro/config.json` file).
util/muxer
Package muxer provides proxy muxing
Package muxer provides proxy muxing
util/pool
Package pool is a connection pool
Package pool is a connection pool
util/qson
Package qson implmenets decoding of URL query params into JSON and Go values (using JSON struct tags).
Package qson implmenets decoding of URL query params into JSON and Go values (using JSON struct tags).
util/ring
Package ring provides a simple ring buffer for storing local data
Package ring provides a simple ring buffer for storing local data
util/selector
Package selector is for node selection and load balancing
Package selector is for node selection and load balancing
util/socket
Package socket provides a pseudo socket
Package socket provides a pseudo socket
util/sync
Package sync is an interface for distributed synchronization
Package sync is an interface for distributed synchronization
util/sync/memory
Package memory provides a sync.Mutex implementation of the lock for local use
Package memory provides a sync.Mutex implementation of the lock for local use
services module
address command
ai command
app command
avatar command
bitcoin command
cache command
carbon command
chat command
comments command
contact command
cron command
crypto command
currency command
db command
dns command
email command
ethereum command
evchargers command
event command
file command
forex command
function command
geocoding command
gifs command
github command
google command
helloworld command
holidays command
id command
image command
ip command
lists command
location command
memegen command
minecraft command
movie command
mq command
news command
nft command
notes command
otp command
password command
ping command
pkg/api
Package api is a helper for calling external third party apis
Package api is a helper for calling external third party apis
pkg/cache
Cache provides a simple marshaling layer on top of the store
Cache provides a simple marshaling layer on top of the store
pkg/model
package model helps with data modelling on top of the store
package model helps with data modelling on top of the store
pkg/tenant
Package tenant provides multi-tenancy helpers
Package tenant provides multi-tenancy helpers
place command
postcode command
prayer command
price command
qr command
quran command
routing command
rss command
search command
secret command
sentiment command
sms command
space command
spam command
stock command
stream command
sunnah command
test/blob-store command
test/chat command
test/chat/client command
Package main is a client for the chat service to demonstrate how it would work for a client.
Package main is a client for the chat service to demonstrate how it would work for a client.
test/conf command
test/events command
test/kv command
test/logger command
test/pubsub command
thumbnail command
time command
translate command
tunnel command
twitter command
url command
user command
vehicle command
wallet command
weather command
youtube command
tools
api-publisher command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL