I know that I can use
\begin{tikzpicture}
\draw (0,0) to node[midway, above=..., left=..., rotate=45] {A} (1,1) ;
\end{tikzpicture}
to set the position of the label, but it is very tedious to calculate the correct position, and when the rotate angle changed, I may need to recalculate the position. Is there an easier way to set the distance between label and arrow?