repositories

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OrganizationRepository added in v0.5.0

type OrganizationRepository interface {
	// FindAll returns all organizations.
	FindAll(ctx context.Context) ([]*entities.Organization, error)
	// FindByID returns an organization by ID.
	FindByID(ctx context.Context, id uuid.UUID) (*entities.Organization, error)
	// Create creates a new organization.
	Create(ctx context.Context, organization *entities.Organization) error
	// Update updates an organization.
	Update(ctx context.Context, organization *entities.Organization) error
	// Delete deletes an organization by ID.
	Delete(ctx context.Context, id uuid.UUID) error
	// AddMember adds a member to an organization.
	AddMember(ctx context.Context, organizationID, userID uuid.UUID, role string) error
	// RemoveMember removes a member from an organization.
	RemoveMember(ctx context.Context, organizationID, userID uuid.UUID) error
	// FindMembers returns all members of an organization.
	FindMembers(ctx context.Context, organizationID uuid.UUID) ([]*entities.OrganizationMember, error)
	// FindMember returns a member of an organization.
	FindMember(ctx context.Context, organizationID, userID uuid.UUID) (*entities.OrganizationMember, error)
	// FindMemberMemberships returns all memberships of a member.
	FindMemberMemberships(ctx context.Context, userID uuid.UUID) ([]*entities.OrganizationMember, error)
	// UpdateMemberRole updates the role of a member in an organization.
	UpdateMemberRole(ctx context.Context, organizationID, userID uuid.UUID, role string) error
	// AddTeam adds a team to an organization.
	AddTeam(ctx context.Context, organizationID, teamID uuid.UUID) error
	// RemoveTeam removes a team from an organization.
	RemoveTeam(ctx context.Context, organizationID, teamID uuid.UUID) error
}

type TaskRepository

type TaskRepository interface {
	// FindAll returns all tasks.
	FindAll(ctx context.Context, scope *entities.TaskScope) ([]*entities.Task, error)
	// FindByID returns a task by ID.
	FindByID(ctx context.Context, id uuid.UUID, scope *entities.TaskScope) (*entities.Task, error)
	// Create creates a new task.
	Create(ctx context.Context, task *entities.Task) error
	// Update updates a task.
	Update(ctx context.Context, task *entities.Task) error
	// Delete deletes a task by ID.
	Delete(ctx context.Context, id uuid.UUID) error
}

type TaskRunRepository

type TaskRunRepository interface {
	// FindAll returns all task runs.
	FindAll(ctx context.Context) ([]*entities.TaskRun, error)
	// FindByID returns a task run by ID.
	FindByID(ctx context.Context, id uuid.UUID) (*entities.TaskRun, error)
	// FindByTaskID returns all task runs for a task.
	FindByTaskID(ctx context.Context, taskID uuid.UUID) ([]*entities.TaskRun, error)
	// Create creates a new task run.
	Create(ctx context.Context, taskRun *entities.TaskRun) error
	// Update updates a task run.
	Update(ctx context.Context, taskRun *entities.TaskRun) error
	// Delete deletes a task run by ID.
	Delete(ctx context.Context, id uuid.UUID) error
}

type TeamRepository

type TeamRepository interface {
	// FindAll returns all teams.
	FindAll(ctx context.Context) ([]*entities.Team, error)
	// FindByID returns a team by ID.
	FindByID(ctx context.Context, id uuid.UUID) (*entities.Team, error)
	// Create creates a new team.
	Create(ctx context.Context, team *entities.Team) error
	// Update updates a team.
	Update(ctx context.Context, team *entities.Team) error
	// Delete deletes a team by ID.
	Delete(ctx context.Context, id uuid.UUID) error
	// AddMember adds a member to a team.
	AddMember(ctx context.Context, teamID, userID uuid.UUID, role string) error
	// RemoveMember removes a member from a team.
	RemoveMember(ctx context.Context, teamID, userID uuid.UUID) error
	// FindMembers returns all members of a team.
	FindMembers(ctx context.Context, teamID uuid.UUID) ([]*entities.TeamMember, error)
	// FindMember returns a member of a team.
	FindMember(ctx context.Context, teamID, userID uuid.UUID) (*entities.TeamMember, error)
	// FindMemberMemberships returns all memberships of a member.
	FindMemberMemberships(ctx context.Context, userID uuid.UUID) ([]*entities.TeamMember, error)
	// UpdateMemberRole updates the role of a member in a team.
	UpdateMemberRole(ctx context.Context, teamID, userID uuid.UUID, role string) error
}

TeamRepository is a repository that manages teams.

type TriggerRepository

type TriggerRepository interface {
	// FindAll returns all triggers.
	FindAll(ctx context.Context) ([]*entities.Trigger, error)
	// FindByID returns a trigger by ID.
	FindByID(ctx context.Context, id uuid.UUID) (*entities.Trigger, error)
	// Create creates a new trigger.
	Create(ctx context.Context, trigger *entities.Trigger) error
	// Update updates a trigger.
	Update(ctx context.Context, trigger *entities.Trigger) error
	// Delete deletes a trigger by ID.
	Delete(ctx context.Context, id uuid.UUID) error
}

TriggerRepository is a repository that manages triggers.

type UserRepository

type UserRepository interface {
	// FindAll returns all users.
	FindAll(ctx context.Context) ([]*entities.User, error)
	// FindByID returns a user by ID.
	FindByID(ctx context.Context, id uuid.UUID) (*entities.User, error)
	// FindByEmail returns a user by email.
	FindByEmail(ctx context.Context, email string) (*entities.User, error)
	// Create creates a new user.
	Create(ctx context.Context, user *entities.User) error
	// Update updates a user.
	Update(ctx context.Context, user *entities.User) error
	// Delete deletes a user by ID.
	Delete(ctx context.Context, id uuid.UUID) error
}

UserRepository is a repository that manages users.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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