Commit e26b9fdf authored by owlo's avatar owlo

you can create a user, and itll load said user into memory at boot

parent 1e717d65
No preview for this file type
......@@ -244,7 +244,7 @@ func updateBork(currentActors string) libs.ActorS {
return mockup
}
func initActors(currentActors string) string {
func initActors(currentActors string) libs.ActorS {
actorFile, err := os.Open(currentActors)
defer actorFile.Close()
if err != nil {
......@@ -276,7 +276,7 @@ func initActors(currentActors string) string {
//fmt.Println(k)
//fmt.Println(string(actorReader))
fmt.Println(mockup)
emptyString := ""
emptyString := mockup
return emptyString
}
func UIDMaker(typeS string) string {
......@@ -375,7 +375,15 @@ func main() {
numBorks := len(dirBorks)
numStringBorks := strconv.Itoa(numBorks)
fmt.Println("\033[38;2;20;20;255mInitializing actor accounts\033[0m")
initializedActors := initActors("tests/actor.json")
currentActors, err := ioutil.ReadDir("tests/users/")
if err != nil {
fmt.Println("Error reading the user directory!")
}
var initializedActors []libs.ActorS
for i := range currentActors {
initializedActors = append(initializedActors, initActors("tests/users/"+currentActors[i].Name()))
}
fmt.Println(initializedActors)
fmt.Println("\033[48;2;255;20;20mInitialization Complete\033[0m")
fmt.Println(numStringBorks)
......
{"Password":"bork","Summary":"","LastBork":"","Source":null,"Type":"","Following":"http://snowcrash.network#following/guarddoggo","Followers":"http://snowcrash.network#followers/guarddoggo","Liked":"","Inbox":"http://snowcrash.network#inbox/guarddoggo","Outbox":"http://snowcrash.network#outbox/guarddoggo","Url":"","Attachment":{"TypeS":"","Content":"","Url":""},"AttributedTo":{"TypeS":"","Name":""},"Audience":{"TypeS":"","Name":""},"Content":"","Id":"","Context":null,"Name":{"Context":"","TypeS":"","Name":""},"EndTime":{"Context":"","TypeS":"","Name":"","StartTime":"","EndTime":""},"Generator":{"TypeS":"","Name":""},"Icon":null,"InReplyTo":{"Summary":"","TypeS":"","Content":""},"Location":{"Name":"","TypeS":"","Place":""},"Preview":"","Published":"","Replies":{"TypeS":"","TotalItems":0,"Items":null},"StartTime":"","Tag":{"TypeS":"","Id":"","Name":""},"Updated":"","To":"","Bto":"","Cc":"","Bcc":"","MediaType":"","Duration":"","Position":{"Y":null,"X":null},"Streams":{"Location":"","Obj":{"Attachment":{"TypeS":"","Content":"","Url":""},"AttributedTo":{"TypeS":"","Name":""},"Audience":{"TypeS":"","Name":""},"Content":{"Content":"","Summary":"","TypeS":"","MediaType":""},"Context":{"Context":"","Summary":"","TypeS":"","Items":null},"Name":{"Context":"","TypeS":"","Name":""},"EndTime":{"Context":"","TypeS":"","Name":"","StartTime":"","EndTime":""},"Generator":{"TypeS":"","Name":""},"Icon":{"TypeS":"","Name":"","Url":"","Width":0,"Height":0},"InReplyTo":{"Summary":"","TypeS":"","Content":""},"Location":{"Name":"","TypeS":"","Place":""},"Preview":"","Published":"","Replies":{"TypeS":"","TotalItems":0,"Items":null},"StartTime":"","Summary":"","Tag":{"TypeS":"","Id":"","Name":""},"Updated":"","Url":"","To":"","Bto":"","Cc":"","Bcc":"","MediaType":"","Duration":"","Position":{"Y":null,"X":null}},"TotalItems":0,"Current":null,"First":"","Last":"","Items":null},"PreferredUsername":"guarddoggo","Endpoints":{}}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment