Documentation ¶
Overview ¶
Copyright © 2021 Anton Kaiukov <batko@batko.ru>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2021 Anton Kaiukov <batko@batko.ru>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2021 Anton Kaiukov <batko@batko.ru>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2021 Anton Kaiukov <batko@batko.ru>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- type FirestoreGCTrackerData
- func (d *FirestoreGCTrackerData) CreateCase(c GCTrackerCase) error
- func (d *FirestoreGCTrackerData) CreateUser(user GCTrackerUser) error
- func (d *FirestoreGCTrackerData) DeleteCase(c GCTrackerCase) error
- func (d *FirestoreGCTrackerData) GetAllCases() []GCTrackerCase
- func (d *FirestoreGCTrackerData) GetCase(c string) (*firestore.DocumentSnapshot, error)
- func (d *FirestoreGCTrackerData) GetCases(ids []string) []GCTrackerCase
- func (d *FirestoreGCTrackerData) GetUser(username string) (*firestore.DocumentSnapshot, error)
- func (d *FirestoreGCTrackerData) GetUserByResetToken(token string) (GCTrackerUser, error)
- func (d *FirestoreGCTrackerData) GetUsers() ([]*firestore.DocumentSnapshot, error)
- func (d *FirestoreGCTrackerData) GetUsersByCase(id string) []GCTrackerUser
- func (d *FirestoreGCTrackerData) NewCase() GCTrackerCase
- func (d *FirestoreGCTrackerData) NewSession() sessions.Store
- func (d *FirestoreGCTrackerData) NewUser() GCTrackerUser
- func (d *FirestoreGCTrackerData) UpdateUser(user GCTrackerUser) error
- func (d *FirestoreGCTrackerData) UserAvailable(username string) bool
- type GCTrackerCase
- type GCTrackerCaseImpl
- func (c *GCTrackerCaseImpl) CheckStatus() error
- func (c *GCTrackerCaseImpl) Create()
- func (c *GCTrackerCaseImpl) Delete()
- func (c *GCTrackerCaseImpl) GetByID(id string) error
- func (c *GCTrackerCaseImpl) GetID() string
- func (c *GCTrackerCaseImpl) GetName() string
- func (c *GCTrackerCaseImpl) GetStatus() string
- func (c *GCTrackerCaseImpl) Set(formData url.Values)
- func (c *GCTrackerCaseImpl) Validate() error
- type GCTrackerData
- type GCTrackerUser
- type GCTrackerUserImpl
- func (u *GCTrackerUserImpl) AddCase(c GCTrackerCase) error
- func (u *GCTrackerUserImpl) Authenticate() error
- func (u *GCTrackerUserImpl) DelCase(c string)
- func (u *GCTrackerUserImpl) GenerateResetToken(url string) error
- func (u *GCTrackerUserImpl) GetByUsername(username string) error
- func (u *GCTrackerUserImpl) GetCases() []GCTrackerCase
- func (u *GCTrackerUserImpl) GetUsername() string
- func (u *GCTrackerUserImpl) HashAndSalt() error
- func (u *GCTrackerUserImpl) SendNotification(msg string)
- func (u *GCTrackerUserImpl) Set(formData url.Values)
- func (u *GCTrackerUserImpl) SetPassword2(p1, p2 string)
- func (u *GCTrackerUserImpl) Update() error
- func (u *GCTrackerUserImpl) Validate(checkAvailable bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FirestoreGCTrackerData ¶
type FirestoreGCTrackerData struct{}
func (*FirestoreGCTrackerData) CreateCase ¶
func (d *FirestoreGCTrackerData) CreateCase(c GCTrackerCase) error
func (*FirestoreGCTrackerData) CreateUser ¶
func (d *FirestoreGCTrackerData) CreateUser(user GCTrackerUser) error
func (*FirestoreGCTrackerData) DeleteCase ¶
func (d *FirestoreGCTrackerData) DeleteCase(c GCTrackerCase) error
func (*FirestoreGCTrackerData) GetAllCases ¶
func (d *FirestoreGCTrackerData) GetAllCases() []GCTrackerCase
func (*FirestoreGCTrackerData) GetCase ¶
func (d *FirestoreGCTrackerData) GetCase(c string) (*firestore.DocumentSnapshot, error)
func (*FirestoreGCTrackerData) GetCases ¶
func (d *FirestoreGCTrackerData) GetCases(ids []string) []GCTrackerCase
func (*FirestoreGCTrackerData) GetUser ¶
func (d *FirestoreGCTrackerData) GetUser(username string) (*firestore.DocumentSnapshot, error)
func (*FirestoreGCTrackerData) GetUserByResetToken ¶
func (d *FirestoreGCTrackerData) GetUserByResetToken(token string) (GCTrackerUser, error)
func (*FirestoreGCTrackerData) GetUsers ¶
func (d *FirestoreGCTrackerData) GetUsers() ([]*firestore.DocumentSnapshot, error)
func (*FirestoreGCTrackerData) GetUsersByCase ¶
func (d *FirestoreGCTrackerData) GetUsersByCase(id string) []GCTrackerUser
func (*FirestoreGCTrackerData) NewCase ¶
func (d *FirestoreGCTrackerData) NewCase() GCTrackerCase
func (*FirestoreGCTrackerData) NewSession ¶
func (d *FirestoreGCTrackerData) NewSession() sessions.Store
func (*FirestoreGCTrackerData) NewUser ¶
func (d *FirestoreGCTrackerData) NewUser() GCTrackerUser
func (*FirestoreGCTrackerData) UpdateUser ¶
func (d *FirestoreGCTrackerData) UpdateUser(user GCTrackerUser) error
func (*FirestoreGCTrackerData) UserAvailable ¶
func (d *FirestoreGCTrackerData) UserAvailable(username string) bool
type GCTrackerCase ¶
type GCTrackerCaseImpl ¶
type GCTrackerCaseImpl struct { ID string `firestore:"id" schema:"case" validate:"alphanum,len=13"` Name string `firestore:"name" schema:"name" validate:"alphanum,min=0,max=40"` Status string `firestore:"status" schema:"-"` OldStatus string `firestore:"old" schema:"-"` // contains filtered or unexported fields }
func (*GCTrackerCaseImpl) CheckStatus ¶
func (c *GCTrackerCaseImpl) CheckStatus() error
func (*GCTrackerCaseImpl) Create ¶
func (c *GCTrackerCaseImpl) Create()
func (*GCTrackerCaseImpl) Delete ¶
func (c *GCTrackerCaseImpl) Delete()
func (*GCTrackerCaseImpl) GetByID ¶
func (c *GCTrackerCaseImpl) GetByID(id string) error
func (*GCTrackerCaseImpl) GetID ¶
func (c *GCTrackerCaseImpl) GetID() string
func (*GCTrackerCaseImpl) GetName ¶
func (c *GCTrackerCaseImpl) GetName() string
func (*GCTrackerCaseImpl) GetStatus ¶
func (c *GCTrackerCaseImpl) GetStatus() string
func (*GCTrackerCaseImpl) Set ¶
func (c *GCTrackerCaseImpl) Set(formData url.Values)
func (*GCTrackerCaseImpl) Validate ¶
func (c *GCTrackerCaseImpl) Validate() error
type GCTrackerData ¶
type GCTrackerData interface { NewSession() sessions.Store NewUser() GCTrackerUser UserAvailable(string) bool GetUser(string) (*firestore.DocumentSnapshot, error) UpdateUser(user GCTrackerUser) error GetUserByResetToken(string) (GCTrackerUser, error) GetUsersByCase(string) []GCTrackerUser CreateUser(GCTrackerUser) error NewCase() GCTrackerCase GetCase(string) (*firestore.DocumentSnapshot, error) GetCases([]string) []GCTrackerCase GetAllCases() []GCTrackerCase CreateCase(GCTrackerCase) error DeleteCase(GCTrackerCase) error }
type GCTrackerUser ¶
type GCTrackerUser interface { Set(url.Values) Authenticate() error Validate(bool) error HashAndSalt() error SendNotification(string) GetUsername() string GetByUsername(string) error GenerateResetToken(string) error SetPassword2(string, string) Update() error AddCase(GCTrackerCase) error DelCase(string) GetCases() []GCTrackerCase }
type GCTrackerUserImpl ¶
type GCTrackerUserImpl struct { Username string `firestore:"username" schema:"username" validate:"required,min=2,max=80,alphanum,available"` Email string `firestore:"email" schema:"email" validate:"required,email"` Password string `firestore:"password" schema:"password" validate:"required,min=8,max=80,eqfield=ConfirmPassword"` ConfirmPassword string `firestore:"-" schema:"password2"` Cases map[string]bool `firestore:"cases" schema:"-"` Reset resetPassword `firestore:"reset" schema:"-"` // contains filtered or unexported fields }
func (*GCTrackerUserImpl) AddCase ¶
func (u *GCTrackerUserImpl) AddCase(c GCTrackerCase) error
func (*GCTrackerUserImpl) Authenticate ¶
func (u *GCTrackerUserImpl) Authenticate() error
func (*GCTrackerUserImpl) DelCase ¶
func (u *GCTrackerUserImpl) DelCase(c string)
func (*GCTrackerUserImpl) GenerateResetToken ¶
func (u *GCTrackerUserImpl) GenerateResetToken(url string) error
func (*GCTrackerUserImpl) GetByUsername ¶
func (u *GCTrackerUserImpl) GetByUsername(username string) error
func (*GCTrackerUserImpl) GetCases ¶
func (u *GCTrackerUserImpl) GetCases() []GCTrackerCase
func (*GCTrackerUserImpl) GetUsername ¶
func (u *GCTrackerUserImpl) GetUsername() string
func (*GCTrackerUserImpl) HashAndSalt ¶
func (u *GCTrackerUserImpl) HashAndSalt() error
func (*GCTrackerUserImpl) SendNotification ¶
func (u *GCTrackerUserImpl) SendNotification(msg string)
func (*GCTrackerUserImpl) Set ¶
func (u *GCTrackerUserImpl) Set(formData url.Values)
func (*GCTrackerUserImpl) SetPassword2 ¶
func (u *GCTrackerUserImpl) SetPassword2(p1, p2 string)
func (*GCTrackerUserImpl) Update ¶
func (u *GCTrackerUserImpl) Update() error
func (*GCTrackerUserImpl) Validate ¶
func (u *GCTrackerUserImpl) Validate(checkAvailable bool) error