data

package
v0.0.0-...-b8c5a9a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 25, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

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

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 (*FirestoreGCTrackerData) GetCases

func (d *FirestoreGCTrackerData) GetCases(ids []string) []GCTrackerCase

func (*FirestoreGCTrackerData) GetUser

func (*FirestoreGCTrackerData) GetUserByResetToken

func (d *FirestoreGCTrackerData) GetUserByResetToken(token string) (GCTrackerUser, error)

func (*FirestoreGCTrackerData) GetUsers

func (*FirestoreGCTrackerData) GetUsersByCase

func (d *FirestoreGCTrackerData) GetUsersByCase(id string) []GCTrackerUser

func (*FirestoreGCTrackerData) NewCase

func (*FirestoreGCTrackerData) NewSession

func (d *FirestoreGCTrackerData) NewSession() sessions.Store

func (*FirestoreGCTrackerData) NewUser

func (*FirestoreGCTrackerData) UpdateUser

func (d *FirestoreGCTrackerData) UpdateUser(user GCTrackerUser) error

func (*FirestoreGCTrackerData) UserAvailable

func (d *FirestoreGCTrackerData) UserAvailable(username string) bool

type GCTrackerCase

type GCTrackerCase interface {
	CheckStatus() error
	Create()
	Set(url.Values)
	GetID() string
	GetName() string
	GetStatus() string
	Validate() error
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL