project

package
v0.0.0-...-89d7f24 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Invitation

type Invitation string

Invitation defines the type of the invitation that is sent by the Owner of the project to other users

const (
	// PendingInvitation is the state when the Invitation is sent but not accepted
	PendingInvitation Invitation = "Pending"

	// AcceptedInvitation is the state when the Invitation is accepted
	AcceptedInvitation Invitation = "Accepted"

	// DeclinedInvitation is the state when the Invitation is rejected/declined
	DeclinedInvitation Invitation = "Declined"

	// ExitedProject is the state when the user has exited the project
	ExitedProject Invitation = "Exited"
)

type Member

type Member struct {
	UserID     string     `bson:"user_id"`
	Role       MemberRole `bson:"role"`
	Invitation Invitation `bson:"invitation"`
	JoinedAt   int64      `bson:"joined_at"`
}

Member contains the required fields to be stored in the database for a member

type MemberRole

type MemberRole string

MemberRole defines the project role a member has in the project

const (
	RoleOwner    MemberRole = "Owner"
	RoleExecutor MemberRole = "Executor"
	RoleViewer   MemberRole = "Viewer"
)

type Operator

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

Operator is the model for cluster collection

func NewProjectOperator

func NewProjectOperator(mongodbOperator mongodb.MongoOperator) *Operator

NewProjectOperator returns a new instance of Operator

func (*Operator) WatchProjectEvents

func (c *Operator) WatchProjectEvents(ctx context.Context, pipeline mongo.Pipeline, client *mongo.Client) (*mongo.ChangeStream, error)

type Project

type Project struct {
	mongodb.Audit `bson:",inline"`
	ID            string    `bson:"_id"`
	Name          string    `bson:"name"`
	Members       []*Member `bson:"members"`
	State         *string   `bson:"state"`
}

Project contains the required fields to be stored in the database for a project

type ProjectCreationEvent

type ProjectCreationEvent struct {
	OperationType string  `bson:"operationType"`
	FullDocument  Project `bson:"fullDocument"`
}

Jump to

Keyboard shortcuts

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