Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMockRepository ¶
func NewMockRepository() *mockRepository
func ValidateCreateRequest ¶
func ValidateCreateRequest(c *auth.CreateDomainRequest) error
ValidateCreateRequest validates the CreateDomainRequest fields.
func ValidateUpdateRequest ¶
func ValidateUpdateRequest(u *auth.UpdateDomainRequest) error
Validate validates the UpdateDomainRequest fields.
Types ¶
type Repository ¶
type Repository interface { // Get returns the domain with the specified domain UUID. Get(ctx context.Context, uuid string) (entity.Domain, error) // GetByName returns the domain with the specified domain name. GetByName(ctx context.Context, name string) (entity.Domain, error) // Count returns the number of domains. Count(ctx context.Context) (int64, error) // Query returns the list of domains with the given offset and limit. Query(ctx context.Context, query string, offset, limit int64) ([]entity.Domain, int, error) // Create saves a new domain in the storage. Create(ctx context.Context, domain entity.Domain) (string, error) // Update updates the domain with given UUID in the storage. Update(ctx context.Context, domain entity.Domain) error // Delete removes the domain with given UUID from the storage. Delete(ctx context.Context, domain entity.Domain) error }
Repository encapsulates the logic to access domains from the data source.
func NewRepository ¶
func NewRepository(db *db.DB) Repository
NewRepository creates a new domain repository
type Service ¶
type Service interface { Get(ctx context.Context, uuid string) (*auth.Domain, error) Query(ctx context.Context, query string, offset, limit int64) (*auth.ListDomainsResponse, error) Count(ctx context.Context) (int64, error) Create(ctx context.Context, input *auth.CreateDomainRequest) (*auth.Domain, error) Update(ctx context.Context, input *auth.UpdateDomainRequest) (*auth.Domain, error) Delete(ctx context.Context, uuid string) (*auth.Domain, error) }
Service encapsulates use case logic for domains.
Click to show internal directories.
Click to hide internal directories.