If is a small category (or even a topological category), one can define a -torsor (or torsor with structure category ) which generalizes the torsor (principal bundle) with structure group(oid). We present two variants in slightly different context.
A -torsor over a topological space is given by a functor such that
(surjectivity) every ‘total stalk’ , where , is nonempty;
(transitivity) for any two germs ‘in the same total stalk’, , , there is a span and such that and ;
(freeness) for a parallel pair of morphisms in , for some implies there is a morphism and such that and .
This definition is from the monograph
where it is shown that the classifying space of a category classifies -torsors.
Suppose now is a finitely complete category with a calculus of left fractions whose morphisms are called covers.
in which the square is a pullback. Street says -torsor at for an -torsor trivialized by some cover .