Documentation
¶
Index ¶
- Constants
- func GetDataAliasesByName(customer *models.Customer, cuid string, aliases []string) (res types.Aliases, err error)
- func GetVendorMappingByCuid(customer *models.Customer, cuid string) (res *types.VendorMapping, err error)
- func HandleCallBlockerOrCancelBlocker(acl *data_models.ACL, customer *models.Customer, cuid string, ...) (errMsg string)
- func HasParam(ps httprouter.Params, name string) bool
- func RecheckIpRangeForAcls(customer *models.Customer) (err error)
- func Unmarshal(request *http.Request, val interface{}) error
- type ACLsController
- func (c *ACLsController) Delete(customer *models.Customer, r *http.Request, p httprouter.Params) (Response, error)
- func (c *ACLsController) Get(customer *models.Customer, r *http.Request, p httprouter.Params) (Response, error)
- func (c *ACLsController) GetAll(customer *models.Customer, r *http.Request, p httprouter.Params) (Response, error)
- func (c *ACLsController) Put(customer *models.Customer, r *http.Request, p httprouter.Params) (Response, error)
- type AliasesController
- func (c *AliasesController) Delete(customer *models.Customer, r *http.Request, p httprouter.Params) (Response, error)
- func (c *AliasesController) Get(customer *models.Customer, r *http.Request, p httprouter.Params) (Response, error)
- func (c *AliasesController) GetAll(customer *models.Customer, r *http.Request, p httprouter.Params) (Response, error)
- func (c *AliasesController) Put(customer *models.Customer, r *http.Request, p httprouter.Params) (Response, error)
- type CapabilitiesController
- type ClientsController
- func (c *ClientsController) Delete(customer *models.Customer, r *http.Request, p httprouter.Params) (Response, error)
- func (c *ClientsController) Get(customer *models.Customer, r *http.Request, p httprouter.Params) (Response, error)
- func (c *ClientsController) Post(customer *models.Customer, r *http.Request, p httprouter.Params) (Response, error)
- func (c *ClientsController) Put(customer *models.Customer, r *http.Request, p httprouter.Params) (Response, error)
- type ErrTag
- type ErrType
- type Error
- type Errors
- type ErrorsResponse
- type Link
- type PostController
- type ResourceDiscoveryController
- type Response
- func EmptyResponse(code int) (Response, error)
- func ErrorResponse(errorCode int, errorTag ErrTag, errorMsg string, isAfterTransaction bool) (Response, error)
- func UpdateACLActivationType(customer *models.Customer, cuid string, ...) (res Response, err error)
- func WithClient(tx *db.Tx, customer *models.Customer, cuid string, ...) (Response, error)
- func WithTransaction(f func(*db.Tx) (Response, error)) (Response, error)
- func YangJsonResponse(content interface{}) (Response, error)
- type VendorMappingController
- func (v *VendorMappingController) DeleteAll(customer *models.Customer, r *http.Request, p httprouter.Params) (Response, error)
- func (v *VendorMappingController) DeleteOne(customer *models.Customer, r *http.Request, p httprouter.Params) (Response, error)
- func (v *VendorMappingController) Get(customer *models.Customer, r *http.Request, p httprouter.Params) (Response, error)
- func (v *VendorMappingController) GetVendorMappingOfServer(customer *models.Customer, r *http.Request, p httprouter.Params) (Response, error)
- func (vc *VendorMappingController) Put(customer *models.Customer, r *http.Request, p httprouter.Params) (Response, error)
- type XRD
Constants ¶
const ( CONTENT_TYPE_YANG_DATA_JSON string = "application/yang-data+json" CONTENT_TYPE_XRD_XML string = "application/xrd+xml" XRD_NAMESPACE string = "http://docs.oasis-open.org/ns/xri/xrd-1.0" )
const (
DEFAULT_ACL_LIFETIME_IN_MINUTES = 7 * 1440
)
const (
DEFAULT_ALIAS_LIFETIME_IN_MINUTES = 7 * 1440
)
Variables ¶
This section is empty.
Functions ¶
func GetDataAliasesByName ¶
func GetDataAliasesByName(customer *models.Customer, cuid string, aliases []string) (res types.Aliases, err error)
* Validate aliases: have they been created by the client * parameter: * customer request source Customer * cuid client identifier * aliases a list of alias-name * return: * res: a list of alias data corresponding to alias-name * err: Error occur in validation progress
func GetVendorMappingByCuid ¶
func GetVendorMappingByCuid(customer *models.Customer, cuid string) (res *types.VendorMapping, err error)
Get vendor-mapping by cuid
func HandleCallBlockerOrCancelBlocker ¶
func HandleCallBlockerOrCancelBlocker(acl *data_models.ACL, customer *models.Customer, cuid string, oldActivateType types.ActivationType) (errMsg string)
* If ACL status is changed from active to inactive => cancel blocker * If ACL status is changed from inactive to active => call blocker
func RecheckIpRangeForAcls ¶
* Re-check ip-address range for data channel acls by customer id * parameter: * customerId the id of updated customer * return: * err error
Types ¶
type ACLsController ¶
type ACLsController struct { }
func (*ACLsController) Delete ¶
func (c *ACLsController) Delete(customer *models.Customer, r *http.Request, p httprouter.Params) (Response, error)
func (*ACLsController) Get ¶
func (c *ACLsController) Get(customer *models.Customer, r *http.Request, p httprouter.Params) (Response, error)
type AliasesController ¶
type AliasesController struct { }
func (*AliasesController) Delete ¶
func (c *AliasesController) Delete(customer *models.Customer, r *http.Request, p httprouter.Params) (Response, error)
func (*AliasesController) Get ¶
func (c *AliasesController) Get(customer *models.Customer, r *http.Request, p httprouter.Params) (Response, error)
type CapabilitiesController ¶
type CapabilitiesController struct { }
type ClientsController ¶
type ClientsController struct { }
func (*ClientsController) Delete ¶
func (c *ClientsController) Delete(customer *models.Customer, r *http.Request, p httprouter.Params) (Response, error)
func (*ClientsController) Get ¶
func (c *ClientsController) Get(customer *models.Customer, r *http.Request, p httprouter.Params) (Response, error)
type ErrTag ¶
type ErrTag string
const ( ErrorTag_In_Use ErrTag = "in-use" // 409 ErrorTag_Lock_Denied ErrTag = "lock-denied" // 409 ErrorTag_Resource_Denied ErrTag = "resource-denied" // 409 ErrorTag_Data_Exists ErrTag = "data-exists" // 409 ErrorTag_Data_Missing ErrTag = "data-missing" // 409 ErrorTag_Invalid_Value ErrTag = "invalid-value" // 400, 404, or 406 ErrorTag_Response_Too_Big ErrTag = "(response) too-big" // 400 ErrorTag_Missing_Attribute ErrTag = "missing-attribute" // 400 ErrorTag_Bad_Attribute ErrTag = "bad-attribute" // 400 ErrorTag_Unknown_Attribute ErrTag = "unknown-attribute" // 400 ErrorTag_Bad_Element ErrTag = "bad-element" // 400 ErrorTag_Unknown_Element ErrTag = "unknown-element" // 400 ErrorTag_Unknown_Namespace ErrTag = "unknown-namespace" // 400 ErrorTag_Malformed_Message ErrTag = "malformed-message" // 400 ErrorTag_Access_Denied ErrTag = "access-denied" // 401 or 403 ErrorTag_Operation_Not_Supported ErrTag = "operation-not-supported" // 405 or 501 ErrorTag_Operation_Failed ErrTag = "operation-failed" // 412 or 500 ErrorTag_Request_Too_Big ErrTag = "(request) too-big" // 413 ErrorTag_Rollback_Failed ErrTag = "rollback-failed" // 500 ErrorTag_Partial_Operation ErrTag = "partial-operation" // 500 )
type Error ¶
type Error struct { ErrorType ErrType `yang:"nonconfig" json:"error-type"` ErrorTag ErrTag `yang:"nonconfig" json:"error-tag"` ErrorMessage string `yang:"nonconfig" json:"error-message"` }
func (*Error) GetDefaultErrorType ¶
type ErrorsResponse ¶
type ErrorsResponse struct {
Errors Errors `json:"ietf-restconf:errors"`
}
type PostController ¶
type PostController struct { }
type ResourceDiscoveryController ¶
type ResourceDiscoveryController struct { }
type Response ¶
func EmptyResponse ¶
func ErrorResponse ¶
func UpdateACLActivationType ¶
func UpdateACLActivationType(customer *models.Customer, cuid string, controlFilteringList []models.ControlFiltering) (res Response, err error)
* Handle Signal Channel Control Filtering: Update activation type for ACLs * parameter: * customer the client * cuid the id of the client * controlFilteringList list of acl control filtering * return: * res the response * err error
func WithClient ¶
func YangJsonResponse ¶
type VendorMappingController ¶
type VendorMappingController struct{}
func (*VendorMappingController) DeleteAll ¶
func (v *VendorMappingController) DeleteAll(customer *models.Customer, r *http.Request, p httprouter.Params) (Response, error)
Delete all vendor-mapping
func (*VendorMappingController) DeleteOne ¶
func (v *VendorMappingController) DeleteOne(customer *models.Customer, r *http.Request, p httprouter.Params) (Response, error)
Delete one vendor-mapping
func (*VendorMappingController) Get ¶
func (v *VendorMappingController) Get(customer *models.Customer, r *http.Request, p httprouter.Params) (Response, error)
Get vendor-mapping
func (*VendorMappingController) GetVendorMappingOfServer ¶
func (v *VendorMappingController) GetVendorMappingOfServer(customer *models.Customer, r *http.Request, p httprouter.Params) (Response, error)
Get vendor-mapping of sever