@ -75,76 +75,69 @@ func (e *hashEncoder) Decode(raw string, t int) (int, error) {
return res [ 0 ] , nil
return res [ 0 ] , nil
}
}
func encodeID ( encoder Encoder , id , t int ) string {
res , _ := encoder . Encode ( [ ] int { id , t } )
return res
}
// EncodeUserID encode user id to hash id
// EncodeUserID encode user id to hash id
func EncodeUserID ( encoder Encoder , uid int ) string {
func EncodeUserID ( encoder Encoder , uid int ) string {
res , _ := encoder . Encode ( [ ] int { uid , UserID } )
return encodeID ( encoder , uid , UserID )
return res
}
}
// EncodeGroupID encode group id to hash id
// EncodeGroupID encode group id to hash id
func EncodeGroupID ( encoder Encoder , uid int ) string {
func EncodeGroupID ( encoder Encoder , uid int ) string {
res , _ := encoder . Encode ( [ ] int { uid , GroupID } )
return encodeID ( encoder , uid , GroupID )
return res
}
}
// EncodePaymentID encode payment id to hash id
// EncodePaymentID encode payment id to hash id
func EncodePaymentID ( encoder Encoder , uid int ) string {
func EncodePaymentID ( encoder Encoder , uid int ) string {
res , _ := encoder . Encode ( [ ] int { uid , PaymentID } )
return encodeID ( encoder , uid , PaymentID )
return res
}
}
// EncodeFileID encode file id to hash id
// EncodeFileID encode file id to hash id
func EncodeFileID ( encoder Encoder , uid int ) string {
func EncodeFileID ( encoder Encoder , uid int ) string {
res , _ := encoder . Encode ( [ ] int { uid , FileID } )
return encodeID ( encoder , uid , FileID )
return res
}
}
// EncodeAuditLogID encode audit log id to hash id
// EncodeAuditLogID encode audit log id to hash id
func EncodeAuditLogID ( encoder Encoder , uid int ) string {
func EncodeAuditLogID ( encoder Encoder , uid int ) string {
res , _ := encoder . Encode ( [ ] int { uid , AuditLogID } )
return encodeID ( encoder , uid , AuditLogID )
return res
}
}
// EncodeTaskID encode task id to hash id
// EncodeTaskID encode task id to hash id
func EncodeTaskID ( encoder Encoder , uid int ) string {
func EncodeTaskID ( encoder Encoder , uid int ) string {
res , _ := encoder . Encode ( [ ] int { uid , TaskID } )
return encodeID ( encoder , uid , TaskID )
return res
}
}
// EncodeEntityID encode entity id to hash id
// EncodeEntityID encode entity id to hash id
func EncodeEntityID ( encoder Encoder , id int ) string {
func EncodeEntityID ( encoder Encoder , id int ) string {
res , _ := encoder . Encode ( [ ] int { id , EntityID } )
return encodeID ( encoder , id , EntityID )
return res
}
}
// EncodeNodeID encode node id to hash id
// EncodeNodeID encode node id to hash id
func EncodeNodeID ( encoder Encoder , id int ) string {
func EncodeNodeID ( encoder Encoder , id int ) string {
res , _ := encoder . Encode ( [ ] int { id , NodeID } )
return encodeID ( encoder , id , NodeID )
return res
}
}
// Encode Entit yID encode policy id to hash id
// Encode Polic yID encode policy id to hash id
func EncodePolicyID ( encoder Encoder , id int ) string {
func EncodePolicyID ( encoder Encoder , id int ) string {
res , _ := encoder . Encode ( [ ] int { id , PolicyID } )
return encodeID ( encoder , id , PolicyID )
return res
}
}
// Encode Entity ID encode share id to hash id
// Encode Share ID encode share id to hash id
func EncodeShareID ( encoder Encoder , id int ) string {
func EncodeShareID ( encoder Encoder , id int ) string {
res , _ := encoder . Encode ( [ ] int { id , ShareID } )
return encodeID ( encoder , id , ShareID )
return res
}
}
// EncodeDavAccountID encode dav account id to hash id
// EncodeDavAccountID encode dav account id to hash id
func EncodeDavAccountID ( encoder Encoder , id int ) string {
func EncodeDavAccountID ( encoder Encoder , id int ) string {
res , _ := encoder . Encode ( [ ] int { id , DavAccountID } )
return encodeID ( encoder , id , DavAccountID )
return res
}
}
// EncodeSourceLinkID encode source link id to hash id
// EncodeSourceLinkID encode source link id to hash id
func EncodeSourceLinkID ( encoder Encoder , id int ) string {
func EncodeSourceLinkID ( encoder Encoder , id int ) string {
res , _ := encoder . Encode ( [ ] int { id , SourceLinkID } )
return encodeID ( encoder , id , SourceLinkID )
return res
}
}
func FromContext ( c context . Context ) int {
func FromContext ( c context . Context ) int {