dwn

package
v0.0.0-...-e11dbd8 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2022 License: Apache-2.0, Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DWN_FAIRX_FEATURE_SESSION_MESSAGES         = "FairXSessionMessages"
	DWN_FAIRX_FEATURE_SESSION_ESTABLISH        = "FairXSessionEstablish"
	DWN_FAIRX_FEATURE_SESSION_EXECUTE_FUNCTION = "FairXSessionExecuteFunction"
)

Variables

This section is empty.

Functions

func Start

func Start()

Types

type ActionsFeatures

type ActionsFeatures struct {
	ThreadsQuery  bool `json:"ThreadsQuery"`
	ThreadsCreate bool `json:"ThreadsCreate"`
	ThreadsReply  bool `json:"ThreadsReply"`
	ThreadsClose  bool `json:"ThreadsClose"`
	ThreadsDelete bool `json:"ThreadsDelete"`
}

type CollectionsFeatures

type CollectionsFeatures struct {
	CollectionsQuery  bool `json:"CollectionsQuery"`
	CollectionsWrite  bool `json:"CollectionsWrite"`
	CollectionsCommit bool `json:"CollectionsCommit"`
	CollectionsDelete bool `json:"CollectionsDelete"`
}

type FairXFeatures

type FairXFeatures struct {
	SessionEstablish       bool `json:"FairXSessionEstablish"`
	SessionExecuteFunction bool `json:"FairXSessionExecuteFunction"`
	SessionMessages        bool `json:"FairXSessionMessages"`
}

type FeatureDetection

type FeatureDetection struct {
	Type       string           `json:"type"`
	Interfaces FeatureInterface `json:"interfaces"`
}
var CurrentFeatureDetection FeatureDetection = FeatureDetection{
	Type: "FeatureDetection",
	Interfaces: FeatureInterface{
		Collections: CollectionsFeatures{
			CollectionsQuery:  false,
			CollectionsWrite:  false,
			CollectionsCommit: false,
			CollectionsDelete: false,
		},
		Actions: ActionsFeatures{
			ThreadsQuery:  false,
			ThreadsCreate: false,
			ThreadsReply:  false,
			ThreadsClose:  false,
			ThreadsDelete: false,
		},
		Permissions: PermissionsFeatures{
			PermissionsRequest: false,
			PermissionsGrant:   false,
			PermissionsRevoke:  false,
		},
		Messaging: MessagingFeatures{
			Batching: true,
		},
		FairX: FairXFeatures{
			SessionEstablish:       true,
			SessionExecuteFunction: true,
			SessionMessages:        true,
		},
	},
}

type FeatureInterface

type FeatureInterface struct {
	Collections CollectionsFeatures `json:"collections,omitempty"`
	Actions     ActionsFeatures     `json:"actions,omitempty"`
	Permissions PermissionsFeatures `json:"permissions,omitempty"`
	Messaging   MessagingFeatures   `json:"messaging,omitempty"`
	FairX       FairXFeatures       `json:"fairx,omitempty"`
}

type HTTPService

type HTTPService struct {
	ListenAddr      string
	ListenPort      int
	Router          *mux.Router
	InterfaceRouter *InterfaceRouter
}

func CreateHTTPService

func CreateHTTPService(domain string, addr string, port int, jwtKey string, messageDocumentStorage storage.DocumentStorage, mailboxDocumentStorage storage.DocumentStorage) *HTTPService

func (*HTTPService) GetRequestObject

func (svc *HTTPService) GetRequestObject(w http.ResponseWriter, r *http.Request) (did.RequestObject, error)

func (*HTTPService) ListenAndServe

func (svc *HTTPService) ListenAndServe() error

func (*HTTPService) ServiceHandler

func (svc *HTTPService) ServiceHandler(w http.ResponseWriter, r *http.Request)

type InterfaceRouter

type InterfaceRouter struct {
	FeatureDetection
	Domain       string
	MessageStore storage.DocumentStorage
	MailboxStore storage.DocumentStorage
}

func CreateInterfaceRouter

func CreateInterfaceRouter(domain string, messageStore storage.DocumentStorage, mailboxStore storage.DocumentStorage) *InterfaceRouter

func (*InterfaceRouter) FeatureDetectionRoute

func (ir *InterfaceRouter) FeatureDetectionRoute() interface{}

func (*InterfaceRouter) Route

func (ir *InterfaceRouter) Route(ro *did.RequestObject, authSubjectDID string) (interface{}, error)

type MessagingFeatures

type MessagingFeatures struct {
	Batching bool `json:"batching"`
}

type PermissionsFeatures

type PermissionsFeatures struct {
	PermissionsRequest bool `json:"PermissionsRequest"`
	PermissionsGrant   bool `json:"PermissionsGrant"`
	PermissionsRevoke  bool `json:"PermissionsRevoke"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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