anime

command module
v0.0.0-...-b829c5b Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: MIT Imports: 9 Imported by: 0

README

Anime Service

This is the Anime service

Generated with

micro new anime --namespace=hanako --type=srv

Getting Started

Configuration

  • FQDN: hanako.srv.anime
  • Type: srv
  • Alias: anime

Requirements

  • Mongodb:
    specify mongodb url and database name on .env.

For development purpose, I personally use docker. I made custom yml to run some of container that needed on this services.

Run this command

make du # For run mongodb
import data to mongodb for the first time

After you run the mongodb container

  1. Enter to the database from the mongo client cli
    $ mongo -u root -p root --authenticationDatabase admin    
    
  2. Create new database and collection
    > use hanako
    > db.createCollection("anime")
    
  3. Enter to your database
    > use hanako
    
  4. Create new credential for your database
    > db.createUser(
       {
         user : "root",
         pwd : "root",
         roles: [ { role: 'root', db: 'admin' } ]
       }
    )
    
  5. Now exit, and to this on the terminal (with your json-array-formatted file)
    $ mongoimport --uri "mongodb://root:root@localhost:27017/hanako" --collection anime --file formatted-anime-offline-database.json --jsonArray
    

Setup

  1. Create a .env file on the folder
  2. Setup the dev environment there, format
mongo_url=mongodb_url
mongo_dbname=mongo_db_database_name
mongo_username=root
mongo_pwd=root

Dependencies

Micro services depend on service discovery. The default is multicast DNS, a zeroconf system.

In the event you need a resilient multi-host setup we recommend etcd.

# install etcd
brew install etcd

# run etcd
etcd

Usage

A Makefile is included for convenience

Build the binary

make build

Run the service

./anime-srv

Build a docker image

make docker

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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