1: \begin{abstract} Let $\Sigma $ be a compact connected and oriented surface with nonempty boundary and let $G$ be a Lie group equipped with a bi-invariant pseudo-Riemannian metric. The moduli space of flat principal $G$-bundles over $\Sigma$ which are trivialized at a finite subset of $\partial\Sigma$ carries a natural quasi-Hamiltonian structure which was introduced by Li-Bland and Severa. By a suitable restriction of the holonomy over $\partial \Sigma$ and of the gauge action, which is called a decoration of $\partial \Sigma$, it is possible to obtain a number of interesting Poisson structures as subquotients of this family of quasi-Hamiltonian structures. In this work we use this quasi-Hamiltonian structure to construct Poisson and symplectic groupoids in a systematic fashion by means of two observations: \begin{enumerate} \item gluing two copies of the same decorated surface along suitable subspaces of their boundaries determines a groupoid structure on the moduli space associated to the new surface, this procedure can be iterated by gluing four copies of the same surface, thereby inducing a double Poisson groupoid structure;
2: \item on the other hand, we can suppose that $G$ is a Lie 2-group, then the groupoid structure on $G$ descends to a groupoid structure on the moduli space of flat $G$-bundles over $\Sigma$. \end{enumerate}
3: These two observations can be combined to produce up to three distinct and compatible groupoid structures on the associated moduli spaces. We illustrate these methods by considering symplectic groupoids over Bruhat cells, twisted moduli spaces and Poisson 2-groups besides the classical examples.
4: \end{abstract}\