forked from mirrors/homebox
feat: items-editor (#5)
* format readme * update logo * format html * add logo to docs * repository for document and document tokens * add attachments type and repository * autogenerate types via scripts * use autogenerated types * attachment type updates * add insured and quantity fields for items * implement HasID interface for entities * implement label updates for items * implement service update method * WIP item update client side actions * check err on attachment * finish types for basic items editor * remove unused var * house keeping
This commit is contained in:
parent
fbc364dcd2
commit
95ab14b866
125 changed files with 15626 additions and 1791 deletions
|
@ -15,7 +15,11 @@ func NewFaker() *Faker {
|
|||
return &Faker{}
|
||||
}
|
||||
|
||||
func (f *Faker) RandomString(length int) string {
|
||||
func (f *Faker) Time() time.Time {
|
||||
return time.Now().Add(time.Duration(f.Num(1, 100)) * time.Hour)
|
||||
}
|
||||
|
||||
func (f *Faker) Str(length int) string {
|
||||
|
||||
b := make([]rune, length)
|
||||
for i := range b {
|
||||
|
@ -24,14 +28,18 @@ func (f *Faker) RandomString(length int) string {
|
|||
return string(b)
|
||||
}
|
||||
|
||||
func (f *Faker) RandomEmail() string {
|
||||
return f.RandomString(10) + "@email.com"
|
||||
func (f *Faker) Path() string {
|
||||
return "/" + f.Str(10) + "/" + f.Str(10) + "/" + f.Str(10)
|
||||
}
|
||||
|
||||
func (f *Faker) RandomBool() bool {
|
||||
func (f *Faker) Email() string {
|
||||
return f.Str(10) + "@email.com"
|
||||
}
|
||||
|
||||
func (f *Faker) Bool() bool {
|
||||
return rand.Intn(2) == 1
|
||||
}
|
||||
|
||||
func (f *Faker) RandomNumber(min, max int) int {
|
||||
func (f *Faker) Num(min, max int) int {
|
||||
return rand.Intn(max-min) + min
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue