iam

package
v0.2.23 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAuthenticationFailed = errors.New("error authenticating member")
	ErrMemberAlreadyExists  = errors.New("error member already exists")
)
View Source
var (
	ErrMemberNotFound = errors.New("member not found")
)

Functions

This section is empty.

Types

type Email

type Email struct {
	// contains filtered or unexported fields
}

func NewEmail

func NewEmail(address string) (Email, error)

func (Email) IsEmpty

func (e Email) IsEmpty() bool

func (Email) String

func (e Email) String() string

type Member

type Member struct {
	// contains filtered or unexported fields
}

func NewMember

func NewMember(
	organizationID OrgID,
	firstName,
	lastName string,
	email Email,
	password Password,
) (*Member, error)

func UnMarshallMember

func UnMarshallMember(
	id MemberID,
	orgID OrgID,
	firstName, lastName, email, password string,
	createdAt time.Time,
) (*Member, error)

func (*Member) Authenticate

func (m *Member) Authenticate(plainTextPassword string) error

func (*Member) CreatedAt

func (m *Member) CreatedAt() time.Time

func (*Member) Email

func (m *Member) Email() Email

func (*Member) FirstName

func (m *Member) FirstName() string

func (*Member) ID

func (m *Member) ID() MemberID

func (*Member) LastName

func (m *Member) LastName() string

func (*Member) OrgID

func (m *Member) OrgID() OrgID

func (*Member) Password

func (m *Member) Password() Password

type MemberID

type MemberID string

func NewMemberID

func NewMemberID() MemberID

func (MemberID) String

func (i MemberID) String() string

type MemberRepository

type MemberRepository interface {
	Insert(ctx context.Context, member *Member) error
	FindByEmail(ctx context.Context, email Email) (*Member, error)
}

type OrgID

type OrgID string

func NewOrgID

func NewOrgID() OrgID

func (OrgID) String

func (i OrgID) String() string

type Organization

type Organization struct {
	// contains filtered or unexported fields
}

func MarshallToOrganization

func MarshallToOrganization(
	id OrgID,
	createdAt time.Time,
	disabledAt *time.Time,
) (*Organization, error)

func NewOrganization

func NewOrganization() *Organization

func (*Organization) CreatedAt

func (o *Organization) CreatedAt() time.Time

func (*Organization) DisabledAt

func (o *Organization) DisabledAt() *time.Time

func (*Organization) ID

func (o *Organization) ID() OrgID

type OrganizationRepository

type OrganizationRepository interface {
	Insert(ctx context.Context, org *Organization) error
}

type Password

type Password struct {
	// contains filtered or unexported fields
}

func NewPassword

func NewPassword(plainText string) (Password, error)

func NewPasswordFromHash

func NewPasswordFromHash(hash string) (Password, error)

func (Password) IsEmpty

func (p Password) IsEmpty() bool

func (Password) String

func (p Password) String() string

Jump to

Keyboard shortcuts

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