eensymachines-in / webapi-accreg Goto Github PK
View Code? Open in Web Editor NEWMicroservice that can handle accounts, CRUD and authentication, app and backend
Microservice that can handle accounts, CRUD and authentication, app and backend
Currently its returning just HTTP 201 Created
// 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
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"`
}
And the timeout also has to be about 3 seconds - or to be considerate for larger queries nothing more than 5 seconds
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
ctn_srvaccs | ERRO[2022-11-12T14:53:51Z] Accounts: No account found email=
ctn_srvaccs | [GIN] 2022/11/12 - 14:53:51 | 404 | 1.578509ms | 172.19.0.1 | PUT "/api/accounts/636fb37fa135d90fdb6c82ed"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.