organization

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: May 5, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service manages all interactions with domain.Organization Store

func NewService

func NewService(store Store) *Service

NewService creates an organization.Service. The organization.Store implementation is the storage backend for the service.

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, id domain.OrganizationID) error

Delete removes the domain.Organization from the Organization Store.

func (*Service) Get

Get returns an domain.Organization and returns ErrOrgNotFound when the Organization is not found.

func (*Service) List

func (s *Service) List(ctx context.Context) ([]domain.Organization, error)

List returns a list of domain.Organization from the Organization Store

func (*Service) Put

func (s *Service) Put(ctx context.Context, org domain.Organization) error

Put stores an Organization in the Service Store.

func (*Service) Shutdown

func (s *Service) Shutdown(ctx context.Context) error

Shutdown gracefully shutsdown the organization.Service store. The ctx should have a timeout that cancels when the deadline is exceeded.

type Store

type Store interface {
	Delete(ctx context.Context, id domain.OrganizationID) error
	Get(ctx context.Context, id domain.OrganizationID) (domain.Organization, error)
	List(ctx context.Context) ([]domain.Organization, error)
	Put(ctx context.Context, org domain.Organization) error
	Shutdown(ctx context.Context) error
}

Store is the storage interface for the organization.Service.

Jump to

Keyboard shortcuts

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