cohort

package
v0.0.0-...-47fbb7a Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2025 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Name is the cohort protocol
	Name = "cohort"
	// PIRUI stores the URI for the message type
	PIURI = "https://dedis.epfl.ch/cohort/1.0"
	// CreateCohortMsgType represents a new cohort creation message
	CreateCohortMsgType        = PIURI + "/create"
	CreateCohortSuccessMsgType = PIURI + "/success"
	CreateCohortErrorMsgType   = PIURI + "/error"
)
View Source
const (

	// StateReceiverCreate denotes a cohort creation was requested.
	StateReceiverCreate = "receiver_create"
	// StateReceiverCreated denotes the cohort was created.
	StateReceiverCreated = "receiver_created"
	// StateReceiverCreateError marks an error during creation.
	StateReceiverCreateError = "receiver_create_error"

	// StateReceiverCreate denotes a cohort creation was requested.
	StateSenderCreate = "sender_create"
	// StateSenderCreated denotes the cohort was created.
	StateSenderCreated = "sender_created"
	// StateSenderCreateError marks an error during creation.
	StateSenderCreateError = "sender_create_error"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ContinueOptions

type ContinueOptions struct {
	CreateCohortSuccess *CreateCohortSuccess
	CreateCohortError   *CreateCohortError
}

ContinueOptions represents options that may be passed in the call to `Continue` on an action event.

type CreateCohort

type CreateCohort struct {
	ID           string `json:"@id"`
	Type         string `json:"@type"`
	Synopsis     string `json:"synopsis"`
	CohortID     string `json:"cohortID"`
	Size         int    `json:"size"`
	Description  string `json:"description"`
	MoreInfoLink string `json:"moreInfoLink"`
	AcceptText   string `json:"acceptText"`
	DenyText     string `json:"denyText"`
	Contact      string `json:"contact"`
}

type CreateCohortError

type CreateCohortError struct {
	ID    string `json:"@id"`
	Type  string `json:"@type"`
	Cause string `json:"cause"`
}

type CreateCohortSuccess

type CreateCohortSuccess struct {
	ID   string `json:"@id"`
	Type string `json:"@type"`
}

type Service

type Service struct {
	service.Action
	service.Message
	// contains filtered or unexported fields
}

func New

func New(prov provider) (*Service, error)

New returns a new instance of Consent Service.

func (*Service) Accept

func (s *Service) Accept(msgType string) bool

Accept returns true for supported incoming message types.

func (*Service) HandleInbound

func (s *Service) HandleInbound(msg service.DIDCommMsg, myDID, theirDID string) (string, error)

func (*Service) HandleOutbound

func (s *Service) HandleOutbound(msg service.DIDCommMsg, from, to string) (string, error)

HandleOutbound handles outbound cohort messages.

func (*Service) Name

func (s *Service) Name() string

Name returns the name of the service

Jump to

Keyboard shortcuts

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