github.com/hyperledger/aries-framework-go@v0.3.2/pkg/common/model/model.go (about)

     1  /*
     2  Copyright SecureKey Technologies Inc. All Rights Reserved.
     3  
     4  SPDX-License-Identifier: Apache-2.0
     5  */
     6  
     7  package model
     8  
     9  import (
    10  	"github.com/hyperledger/aries-framework-go/component/models/did/endpoint"
    11  )
    12  
    13  // EndpointType endpoint type.
    14  type EndpointType = endpoint.EndpointType
    15  
    16  const (
    17  	// DIDCommV1 type.
    18  	DIDCommV1 = endpoint.DIDCommV1
    19  	// DIDCommV2 type.
    20  	DIDCommV2 = endpoint.DIDCommV2
    21  	// Generic type.
    22  	Generic = endpoint.Generic
    23  )
    24  
    25  // ServiceEndpoint api for fetching ServiceEndpoint content based off of a DIDComm V1, V2 or DIDCore format.
    26  type ServiceEndpoint = endpoint.ServiceEndpoint
    27  
    28  // Endpoint contains endpoint specific content. Content of ServiceEndpoint api above will be used by priority:
    29  // 1- DIDcomm V2
    30  // 2- DIDComm V1
    31  // 3- DIDCore
    32  // To force lower priority endpoint content, avoid setting higher priority data during Unmarshal() execution.
    33  type Endpoint = endpoint.Endpoint
    34  
    35  // DIDCommV2Endpoint contains ServiceEndpoint data specifically for DIDcommV2 and is wrapped in Endpoint as an array.
    36  type DIDCommV2Endpoint = endpoint.DIDCommV2Endpoint
    37  
    38  // NewDIDCommV2Endpoint creates a DIDCommV2 endpoint with the given array of endpoints. At the time of writing this
    39  // comment, only the first endpoint is effective in the API. Additional logic is required to use a different index.
    40  func NewDIDCommV2Endpoint(endpoints []DIDCommV2Endpoint) Endpoint {
    41  	return endpoint.NewDIDCommV2Endpoint(endpoints)
    42  }
    43  
    44  // NewDIDCommV1Endpoint creates a DIDCommV1 endpoint.
    45  func NewDIDCommV1Endpoint(uri string) Endpoint {
    46  	return endpoint.NewDIDCommV1Endpoint(uri)
    47  }
    48  
    49  // NewDIDCoreEndpoint creates a generic DIDCore endpoint.
    50  func NewDIDCoreEndpoint(genericEndpoint interface{}) Endpoint {
    51  	return endpoint.NewDIDCoreEndpoint(genericEndpoint)
    52  }