code.gitea.io/gitea@v1.19.3/modules/git/repo_hook.go (about)

     1  // Copyright 2015 The Gogs Authors. All rights reserved.
     2  // SPDX-License-Identifier: MIT
     3  
     4  package git
     5  
     6  // GetHook get one hook according the name on a repository
     7  func (repo *Repository) GetHook(name string) (*Hook, error) {
     8  	return GetHook(repo.Path, name)
     9  }
    10  
    11  // Hooks get all the hooks on the repository
    12  func (repo *Repository) Hooks() ([]*Hook, error) {
    13  	return ListHooks(repo.Path)
    14  }