Code Monkey home page Code Monkey logo

webapi-accreg's People

Contributors

kneerunjun avatar

Stargazers

 avatar

Watchers

 avatar

webapi-accreg's Issues

Sample JSON data to be got as slices

// JsonSampleUserAccounts : shall read the entire file and then send back the block result
func JsonSampleUserAccounts() ([]*UserAccount, error) {
	byt, err := ioutil.ReadFile("useraccs.json")
	if err != nil {
		return nil, err
	}
	result := []*UserAccount{} // the result we send back
	if err := json.Unmarshal(byt, &result); err != nil {
		return nil, err
	}
	return result, nil
}

// JsonSampleRandomAccount : from the entire sample of user accounts this will get the random account
func JsonSampleRandomAccount() (*UserAccount, error) {
	sample, err := JsonSampleUserAccounts()
	if err != nil {
		return nil, err
	}
	rndIndx := rand.Intn(len(sample) - 1)
	return sample[rndIndx], nil
}

We have functions for getting one or all, need to take out a sample slice

Issue with _id in database from model

type UserAccount struct {
	ID    primitive.ObjectID `bson:"_id"`
	Email string             `bson:"email, unique" json:"email"`
	Phone string             `bson:"phone, unique" json:"phone"`
	Title string             `bson:"title" json:"title"`
}

Setup testing using pool inputs

Right now we have a blob of test , while that is sufficient for now we need to break it down to http verb when testing using a pool of inputs being fired

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.