segment

package
v1.48.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package segment is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockRepository

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

MockRepository is a mock of Repository interface.

func NewMockRepository

func NewMockRepository(ctrl *gomock.Controller) *MockRepository

NewMockRepository creates a new mock instance.

func (*MockRepository) Create

func (m *MockRepository) Create(arg0 context.Context, arg1 *mmodel.Segment) (*mmodel.Segment, error)

Create mocks base method.

func (*MockRepository) Delete

func (m *MockRepository) Delete(arg0 context.Context, arg1, arg2, arg3 uuid.UUID) error

Delete mocks base method.

func (*MockRepository) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockRepository) Find

func (m *MockRepository) Find(arg0 context.Context, arg1, arg2, arg3 uuid.UUID) (*mmodel.Segment, error)

Find mocks base method.

func (*MockRepository) FindAll

func (m *MockRepository) FindAll(arg0 context.Context, arg1, arg2 uuid.UUID, arg3 http.Pagination) ([]*mmodel.Segment, error)

FindAll mocks base method.

func (*MockRepository) FindByIDs

func (m *MockRepository) FindByIDs(arg0 context.Context, arg1, arg2 uuid.UUID, arg3 []uuid.UUID) ([]*mmodel.Segment, error)

FindByIDs mocks base method.

func (*MockRepository) FindByName

func (m *MockRepository) FindByName(arg0 context.Context, arg1, arg2 uuid.UUID, arg3 string) (bool, error)

FindByName mocks base method.

func (*MockRepository) Update

func (m *MockRepository) Update(arg0 context.Context, arg1, arg2, arg3 uuid.UUID, arg4 *mmodel.Segment) (*mmodel.Segment, error)

Update mocks base method.

type MockRepositoryMockRecorder

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

MockRepositoryMockRecorder is the mock recorder for MockRepository.

func (*MockRepositoryMockRecorder) Create

func (mr *MockRepositoryMockRecorder) Create(arg0, arg1 any) *gomock.Call

Create indicates an expected call of Create.

func (*MockRepositoryMockRecorder) Delete

func (mr *MockRepositoryMockRecorder) Delete(arg0, arg1, arg2, arg3 any) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockRepositoryMockRecorder) Find

func (mr *MockRepositoryMockRecorder) Find(arg0, arg1, arg2, arg3 any) *gomock.Call

Find indicates an expected call of Find.

func (*MockRepositoryMockRecorder) FindAll

func (mr *MockRepositoryMockRecorder) FindAll(arg0, arg1, arg2, arg3 any) *gomock.Call

FindAll indicates an expected call of FindAll.

func (*MockRepositoryMockRecorder) FindByIDs

func (mr *MockRepositoryMockRecorder) FindByIDs(arg0, arg1, arg2, arg3 any) *gomock.Call

FindByIDs indicates an expected call of FindByIDs.

func (*MockRepositoryMockRecorder) FindByName

func (mr *MockRepositoryMockRecorder) FindByName(arg0, arg1, arg2, arg3 any) *gomock.Call

FindByName indicates an expected call of FindByName.

func (*MockRepositoryMockRecorder) Update

func (mr *MockRepositoryMockRecorder) Update(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call

Update indicates an expected call of Update.

type Repository

type Repository interface {
	Create(ctx context.Context, segment *mmodel.Segment) (*mmodel.Segment, error)
	FindByName(ctx context.Context, organizationID, ledgerID uuid.UUID, name string) (bool, error)
	FindAll(ctx context.Context, organizationID, ledgerID uuid.UUID, filter http.Pagination) ([]*mmodel.Segment, error)
	FindByIDs(ctx context.Context, organizationID, ledgerID uuid.UUID, ids []uuid.UUID) ([]*mmodel.Segment, error)
	Find(ctx context.Context, organizationID, ledgerID, id uuid.UUID) (*mmodel.Segment, error)
	Update(ctx context.Context, organizationID, ledgerID, id uuid.UUID, segment *mmodel.Segment) (*mmodel.Segment, error)
	Delete(ctx context.Context, organizationID, ledgerID, id uuid.UUID) error
}

Repository provides an interface for operations related to segment entities.

type SegmentPostgreSQLModel

type SegmentPostgreSQLModel struct {
	ID                string
	Name              string
	LedgerID          string
	OrganizationID    string
	Status            string
	StatusDescription *string
	CreatedAt         time.Time
	UpdatedAt         time.Time
	DeletedAt         sql.NullTime
	Metadata          map[string]any
}

SegmentPostgreSQLModel represents the entity Segment into SQL context in Database

func (*SegmentPostgreSQLModel) FromEntity

func (t *SegmentPostgreSQLModel) FromEntity(segment *mmodel.Segment)

FromEntity converts an entity.Segment to SegmentPostgreSQLModel

func (*SegmentPostgreSQLModel) ToEntity

func (t *SegmentPostgreSQLModel) ToEntity() *mmodel.Segment

ToEntity converts an SegmentPostgreSQLModel to entity.Segment

type SegmentPostgreSQLRepository

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

SegmentPostgreSQLRepository is a Postgresql-specific implementation of the Repository.

func NewSegmentPostgreSQLRepository

func NewSegmentPostgreSQLRepository(pc *mpostgres.PostgresConnection) *SegmentPostgreSQLRepository

NewSegmentPostgreSQLRepository returns a new instance of SegmentPostgreSQLRepository using the given Postgres connection.

func (*SegmentPostgreSQLRepository) Create

Create a new segment entity into Postgresql and returns it.

func (*SegmentPostgreSQLRepository) Delete

func (p *SegmentPostgreSQLRepository) Delete(ctx context.Context, organizationID, ledgerID, id uuid.UUID) error

Delete removes a Segment entity from the database using the provided IDs.

func (*SegmentPostgreSQLRepository) Find

func (p *SegmentPostgreSQLRepository) Find(ctx context.Context, organizationID, ledgerID, id uuid.UUID) (*mmodel.Segment, error)

Find retrieves a Segment entity from the database using the provided ID.

func (*SegmentPostgreSQLRepository) FindAll

func (p *SegmentPostgreSQLRepository) FindAll(ctx context.Context, organizationID, ledgerID uuid.UUID, filter http.Pagination) ([]*mmodel.Segment, error)

FindAll retrieves Segment entities from the database.

func (*SegmentPostgreSQLRepository) FindByIDs

func (p *SegmentPostgreSQLRepository) FindByIDs(ctx context.Context, organizationID, ledgerID uuid.UUID, ids []uuid.UUID) ([]*mmodel.Segment, error)

FindByIDs retrieves Segments entities from the database using the provided IDs.

func (*SegmentPostgreSQLRepository) FindByName

func (p *SegmentPostgreSQLRepository) FindByName(ctx context.Context, organizationID, ledgerID uuid.UUID, name string) (bool, error)

FindByName find segment from the database using Organization and Ledger id and Name.

func (*SegmentPostgreSQLRepository) Update

func (p *SegmentPostgreSQLRepository) Update(ctx context.Context, organizationID, ledgerID, id uuid.UUID, prd *mmodel.Segment) (*mmodel.Segment, error)

Update a Segment entity into Postgresql and returns the Segment updated.

Jump to

Keyboard shortcuts

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