Skip to content
Snippets Groups Projects
design.go 1.84 KiB
Newer Older
  • Learn to ignore specific revisions
  • // nolint:revive
    package design
    
    import . "goa.design/goa/v3/dsl"
    
    var _ = API("signer", func() {
    	Title("Signer Service")
    	Description("The signer service exposes HTTP API for creating and verifying digital signatures.")
    	Server("signer", func() {
    		Description("Signer Server")
    		Host("development", func() {
    			Description("Local development server")
    			URI("http://localhost:8085")
    		})
    	})
    })
    
    
    var _ = Service("signer", func() {
    	Description("Sign service provides endpoints for making digital signatures and proofs for verifiable credentials and presentations.")
    
    	Method("CredentialProof", func() {
    
    		Description("CredentialProof adds a proof to a given Verifiable Credential.")
    
    		Payload(CredentialProofRequest)
    		Result(Any)
    		HTTP(func() {
    			POST("/v1/credential/proof")
    
    			Param("key")
    			Body("credential")
    
    
    	Method("PresentationProof", func() {
    		Description("PresentationProof adds a proof to a given Verifiable Presentation.")
    		Payload(PresentationProofRequest)
    		Result(Any)
    		HTTP(func() {
    			POST("/v1/presentation/proof")
    			Param("key")
    			Body("presentation")
    
    			Response(StatusOK)
    		})
    	})
    
    var _ = Service("health", func() {
    	Description("Health service provides health check endpoints.")
    
    	Method("Liveness", func() {
    		Payload(Empty)
    		Result(Empty)
    		HTTP(func() {
    			GET("/liveness")
    			Response(StatusOK)
    		})
    	})
    
    	Method("Readiness", func() {
    		Payload(Empty)
    		Result(Empty)
    		HTTP(func() {
    			GET("/readiness")
    			Response(StatusOK)
    		})
    	})
    })
    
    var _ = Service("openapi", func() {
    	Description("The openapi service serves the OpenAPI(v3) definition.")
    	Meta("swagger:generate", "false")
    	HTTP(func() {
    		Path("/swagger-ui")
    	})
    	Files("/openapi.json", "./gen/http/openapi3.json", func() {
    		Description("JSON document containing the OpenAPI(v3) service definition")
    	})
    	Files("/{*filepath}", "./swagger/")
    })