account

package
v0.0.0-...-ebd6d4f Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAccountAlreadyActivated = errors.New("account is already activated")
)

Functions

This section is empty.

Types

type Account

type Account struct {
	ID                 uint                          `json:"id"`
	Campaign           campaign.Campaign             `json:"campaign"`
	ActivatedAt        *time.Time                    `json:"activated_at"`
	InvitationToken    string                        `json:"invitation_token,omitempty"`
	InvitationURL      string                        `json:"invitation_url,omitempty"`
	AuthorizationToken string                        `json:"authorization_token,omitempty"`
	Buildings          []building.Building           `json:"buildings,omitempty"`
	CloudFeedAuths     []cloudfeedauth.CloudFeedAuth `json:"cloud_feed_auths,omitempty"`
}

An Account is registered to a research subject.

func MakeAccount

func MakeAccount(campaign campaign.Campaign) Account

Create a new Account.

func (*Account) Activate

func (a *Account) Activate() error

Activate an account. An error will be returned if the account is already activated.

type AccountRepository

type AccountRepository interface {
	Find(account Account) (Account, error)
	GetAll() ([]Account, error)
	Create(Account) (Account, error)
	Update(Account) (Account, error)
	Delete(Account) error
}

An AccountRepository can load, store and delete accounts.

Jump to

Keyboard shortcuts

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