github.com/blend/go-sdk@v1.20220411.3/profanity/glob_filter.go (about)

     1  /*
     2  
     3  Copyright (c) 2022 - Present. Blend Labs, Inc. All rights reserved
     4  Use of this source code is governed by a MIT license that can be found in the LICENSE file.
     5  
     6  */
     7  
     8  package profanity
     9  
    10  // GlobFilter rules for if we should include or exclude file or directory by name.
    11  type GlobFilter struct {
    12  	Filter `yaml:",inline"`
    13  }
    14  
    15  // Match returns the matching glob filter for a given value.
    16  func (gf GlobFilter) Match(value string) (includeMatch, excludeMatch string) {
    17  	return gf.Filter.Match(value, Glob)
    18  }
    19  
    20  // Allow returns if the filters include or exclude a given value.
    21  func (gf GlobFilter) Allow(value string) bool {
    22  	return gf.Filter.Allow(value, Glob)
    23  }