membro

package
v2.0.5+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeApproveMembersEndpoint

func MakeApproveMembersEndpoint(svc MembroService) endpoint.Endpoint

func MakeDraftMembersEndpoint

func MakeDraftMembersEndpoint(svc MembroService) endpoint.Endpoint

func MakeGetMembersEndpoint

func MakeGetMembersEndpoint(svc MembroService) endpoint.Endpoint

func MakeQueryMembersEndpoint

func MakeQueryMembersEndpoint(svc MembroService) endpoint.Endpoint

func MakeRejectMembersEndpoint

func MakeRejectMembersEndpoint(svc MembroService) endpoint.Endpoint

func MakeUpdateMembersEndpoint

func MakeUpdateMembersEndpoint(svc MembroService) endpoint.Endpoint

func MakeValidateTokensEndpoint

func MakeValidateTokensEndpoint(svc MembroService) endpoint.Endpoint

Types

type ApproveMembersRequest

type ApproveMembersRequest struct {
	Organizations []*OrganizationPayload `json:"organizations"`
}

type ApproveMembersResponse

type ApproveMembersResponse struct {
	Organizations []*OrganizationPayload `json:"organizations"`
	Err           string                 `json:"err,omitempty"`
}

type DraftMembersRequest

type DraftMembersRequest struct {
	Organizations []*OrganizationPayload `json:"organizations"`
}

type DraftMembersResponse

type DraftMembersResponse struct {
	DraftMembersRequest
	Err string `json:"err,omitempty"`
}

type Endpoints

type Endpoints struct {
	QueryMembersEndpoint   endpoint.Endpoint
	GetMembersEndpoint     endpoint.Endpoint
	DraftMembersEndpoint   endpoint.Endpoint
	UpdateMembersEndpoint  endpoint.Endpoint
	ApproveMembersEndpoint endpoint.Endpoint
	RejectMembersEndpoint  endpoint.Endpoint
}

type GetMembersRequest

type GetMembersRequest struct {
	Organizations []*OrganizationPayload `json:"organizations"`
}

type GetMembersResponse

type GetMembersResponse struct {
	Organizations []*OrganizationPayload `json:"organizations"`
	Err           string                 `json:"err,omitempty"`
}

type Member

type Member struct {
	ID       string        `json:"id"`
	Token    string        `json:"token"`
	Status   MemberStatus  `json:"status"`
	Internal string        `json:"internal"`
	Name     string        `json:"name"`
	Code     string        `json:"code"`
	Birth    MemberBirth   `json:"birth" datastore:",flatten"`
	Address  MemberAddress `json:"address" datastore:",flatten"`
	Document string        `json:"document"`
	Email    string        `json:"email"`
	Phone    string        `json:"phone"`
}

func (Member) ResolveContact

func (m Member) ResolveContact() interface{}

func (Member) ResolveEmail

func (m Member) ResolveEmail() *mail.Address

type MemberAddress

type MemberAddress struct {
	Place string `json:"place"`
	OLC   string `json:"olc"`
}

type MemberBirth

type MemberBirth struct {
	Date  time.Time `json:"date"`
	Place string    `json:"place"`
}

type MemberStatus

type MemberStatus string
const (
	MemberStatusDraft    MemberStatus = "DRAFT"
	MemberStatusPending  MemberStatus = "PENDING"
	MemberStatusApproved MemberStatus = "APPROVED"
	MemberStatusRejected MemberStatus = "REJECTED"
)

type MembroService

type MembroService interface {
	CountMembers(ctx context.Context, orgID string, status MemberStatus) (int, error)
	QueryMembers(ctx context.Context, orgID string, offset int, limit int, status MemberStatus, members *[]*Member) error
	GetMembers(ctx context.Context, orgID string, memberIDs []string, members []*Member) error
	GetMemberByToken(ctx context.Context, orgID string, token string) (*Member, error)
	DraftMembers(ctx context.Context, orgID string, draftMembers []*Member) error
	UpdateMembers(ctx context.Context, orgID string, members []*Member) error
	UpdateMembersStatus(ctx context.Context, orgID string, members []*Member, newStatus MemberStatus) error
	ValidateToken(ctx context.Context, orgID string, token string) error
}

type OrganizationPayload

type OrganizationPayload struct {
	ID      string    `json:"id"`
	Members []*Member `json:"members"`
	Filter  *Member   `json:"filter"`
	Limit   int       `json:"limit"`
	Offset  int       `json:"offset"`
	Count   int       `json:"count"`
	Error   string    `json:"error,omitempty"`
}

type QueryMembersRequest

type QueryMembersRequest struct {
	Organizations []*OrganizationPayload `json:"organizations"`
}

type QueryMembersResponse

type QueryMembersResponse struct {
	Organizations []*OrganizationPayload `json:"organizations"`
	Err           string                 `json:"err,omitempty"`
}

type RejectMembersRequest

type RejectMembersRequest struct {
	Organizations []*OrganizationPayload `json:"organizations"`
}

type RejectMembersResponse

type RejectMembersResponse struct {
	Organizations []*OrganizationPayload `json:"organizations"`
	Err           string                 `json:"err,omitempty"`
}

type UpdateMembersRequest

type UpdateMembersRequest struct {
	Organizations []*OrganizationPayload `json:"organizations"`
}

type UpdateMembersResponse

type UpdateMembersResponse struct {
	Organizations []*OrganizationPayload `json:"organizations"`
	Err           string                 `json:"err,omitempty"`
}

type ValidateMembersRequest

type ValidateMembersRequest struct {
	Organizations []*OrganizationPayload `json:"organizations"`
}

type ValidateMembersResponse

type ValidateMembersResponse struct {
	ValidateMembersRequest
	Err string `json:"err,omitempty"`
}

type ValidateTokensRequest

type ValidateTokensRequest struct {
	Organizations []*OrganizationPayload `json:"organizations"`
}

type ValidateTokensResponse

type ValidateTokensResponse struct {
	ValidateTokensRequest
	Err string `json:"err,omitempty"`
}

Directories

Path Synopsis
jwt
service
transport

Jump to

Keyboard shortcuts

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