// ApplyLicense will store a license on the local system
437528
func ApplyLicense(ctx context.Context, dclient licensing.WrappedDockerClient, license *model.IssuedLicense) error {
	info, err := dclient.Info(ctx)
	if err != nil {
		return err
	}
	return licensing.StoreLicense(ctx, dclient, license, info.DockerRootDir)
}
217909
func getLicense() License {
	// If explicitly flagged, use that.
	if userLicense != "" {
		return findLicense(userLicense)
	}

	// If user wants to have custom license, use that.
	if viper.IsSet("license.header") || viper.IsSet("license.text") {
		return License{Header: viper.GetString("license.header"),
			Text: viper.GetString("license.text")}
	}

	// If user wants to have built-in license, use that.
	if viper.IsSet("license") {
		return findLicense(viper.GetString("license"))
	}

	// If user didn't set any license, use Apache 2.0 by default.
	return Licenses["apache"]
}
88205
func (s *PublishLayerVersionInput) SetLicenseInfo(v string) *PublishLayerVersionInput {
	s.LicenseInfo = &v
	return s
}
39533
func CopyLicense(dst, src string) error {
	files, err := ioutil.ReadDir(src)
	if err != nil {
		return err
	}
	for _, f := range files {
		if f.IsDir() {
			continue
		}
		for _, candidate := range licenseFiles {
			if strings.ToLower(candidate) == strings.TrimSuffix(
				strings.TrimSuffix(strings.ToLower(f.Name()), ".md"), ".txt") {
				if err := Copyfile(filepath.Join(dst, f.Name()),
					filepath.Join(src, f.Name())); err != nil {
					return err
				}
			}
		}
	}
	return nil
}
1251504
func (p *Policy) Apply(path *Path, options *PolicyOptions) (RouteType, *Path) {
	for _, stmt := range p.Statements {
		var result RouteType
		result, path = stmt.Apply(path, options)
		if result != ROUTE_TYPE_NONE {
			return result, path
		}
	}
	return ROUTE_TYPE_NONE, path
}
856275
func (c *cfn) Apply(s string) (rest string, ok bool) {
	return c.fn(s)
}
1285934
func (s *UpdateReplicationJobInput) SetLicenseType(v string) *UpdateReplicationJobInput {
	s.LicenseType = &v
	return s
}
674526
func (p *Proxy) Apply(dbName string, i interface{}) {
	p.ApplyLazy(gsd.Lazy(dbName), i)
}
1234883
func (s *LicenseConfiguration) SetLicenseConfigurationId(v string) *LicenseConfiguration {
	s.LicenseConfigurationId = &v
	return s
}
1048208
func (s *PublishLayerVersionOutput) SetLicenseInfo(v string) *PublishLayerVersionOutput {
	s.LicenseInfo = &v
	return s
}
424450
func (s *PlayReadyDrm) SetLicenseAcquisitionUrl(v string) *PlayReadyDrm {
	s.LicenseAcquisitionUrl = &v
	return s
}
1119381
func (s *LicenseConfiguration) SetLicenseRules(v []*string) *LicenseConfiguration {
	s.LicenseRules = v
	return s
}
877345
func (s *ReplicationJob) SetLicenseType(v string) *ReplicationJob {
	s.LicenseType = &v
	return s
}
517607
func (s *DBSnapshot) SetLicenseModel(v string) *DBSnapshot {
	s.LicenseModel = &v
	return s
}
1052254
func (exp *expirationRejectRule) Apply(message *common.Envelope) error {
	ordererConf, ok := exp.filterSupport.OrdererConfig()
	if !ok {
		logger.Panic("Programming error: orderer config not found")
	}
	if !ordererConf.Capabilities().ExpirationCheck() {
		return nil
	}
	signedData, err := message.AsSignedData()

	if err != nil {
		return errors.Errorf("could not convert message to signedData: %s", err)
	}
	expirationTime := crypto.ExpiresAt(signedData[0].Identity)
	// Identity cannot expire, or identity has not expired yet
	if expirationTime.IsZero() || time.Now().Before(expirationTime) {
		return nil
	}
	return errors.New("identity expired")
}
305346
func (s *GetLicenseConfigurationOutput) SetLicenseCount(v int64) *GetLicenseConfigurationOutput {
	s.LicenseCount = &v
	return s
}
217491
func (s *RepositoriesService) License(ctx context.Context, owner, repo string) (*RepositoryLicense, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/license", owner, repo)
	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	r := &RepositoryLicense{}
	resp, err := s.client.Do(ctx, req, r)
	if err != nil {
		return nil, resp, err
	}

	return r, resp, nil
}