// WithContentStore sets the content store.
175240
func WithContentStore(contentStore content.Store) ServicesOpt {
	return func(s *services) {
		s.contentStore = contentStore
	}
}
772426
func (s *Server) WithStore(store storage.Store) *Server {
	s.store = store
	return s
}
918383
func NewOrganizationsStore(s chronograf.OrganizationsStore, org string) *OrganizationsStore {
	return &OrganizationsStore{
		store:        s,
		organization: org,
	}
}
672731
func (s *ListObjectsV2Output) SetContents(v []*Object) *ListObjectsV2Output {
	s.Contents = v
	return s
}
48289
func (c *Config) WithContentType(ct string) *Config {
	c.ContentType = ct
	return c
}
296377
func (p pageContent) contentToRender(renderedShortcodes map[string]string) []byte {
	source := p.source.parsed.Input()

	c := make([]byte, 0, len(source)+(len(source)/10))

	for _, it := range p.cmap.items {
		switch v := it.(type) {
		case pageparser.Item:
			c = append(c, source[v.Pos:v.Pos+len(v.Val)]...)
		case pageContentReplacement:
			c = append(c, v.val...)
		case *shortcode:
			if !p.renderable || !v.insertPlaceholder() {
				// Insert the rendered shortcode.
				renderedShortcode, found := renderedShortcodes[v.placeholder]
				if !found {
					// This should never happen.
					panic(fmt.Sprintf("rendered shortcode %q not found", v.placeholder))
				}

				c = append(c, []byte(renderedShortcode)...)

			} else {
				// Insert the placeholder so we can insert the content after
				// markdown processing.
				c = append(c, []byte(v.placeholder)...)

			}
		default:
			panic(fmt.Sprintf("unkown item type %T", it))
		}
	}

	return c
}
76409
func (s *Playlist) SetHlsContentProtection(v *HlsContentProtection) *Playlist {
	s.HlsContentProtection = v
	return s
}
266308
func NewStoreWithDB(size int, network, address, password, DB string, keyPairs ...[]byte) (Store, error) {
	s, err := redistore.NewRediStoreWithDB(size, network, address, password, DB, keyPairs...)
	if err != nil {
		return nil, err
	}
	return &store{s}, nil
}
847896
func NewResourceStore() *ResourceStore {
	return &ResourceStore{
		SecretStore:    make(map[string]*corev1.Secret),
		ConfigMapStore: make(map[string]*corev1.ConfigMap),
	}
}
319241
func (builder *StoreValueCommandBuilder) WithContent(object *Object) *StoreValueCommandBuilder {
	setProtobufFromValue(builder.protobuf, object)
	builder.value = object
	return builder
}
345637
func NewStore() limiter.Store {
	return NewStoreWithOptions(limiter.StoreOptions{
		Prefix:          limiter.DefaultPrefix,
		CleanUpInterval: limiter.DefaultCleanUpInterval,
	})
}
1038936
func (cas *ContentAddressedStore) Put(data []byte) ([]byte, error) {
	hasher := sha256.New()
	_, err := hasher.Write(data)
	if err != nil {
		return nil, fmt.Errorf("ContentAddressedStore could not hash data: %v", err)
	}
	hash := hasher.Sum(nil)
	cas.db.SetSync(hash, data)
	return hash, nil
}
301727
func (c *Cluster) StartStore(storeID uint64) {
	c.Lock()
	defer c.Unlock()

	if store := c.stores[storeID]; store != nil {
		store.meta.State = metapb.StoreState_Up
	}
}
950655
func (m *boxMap) LoadOrStore(key string, value *Box) (*Box, bool) {
	i, _ := m.data.LoadOrStore(key, value)
	s, ok := i.(*Box)
	return s, ok
}
1132271
func (provider *storeProvider) OpenStore(ledgerID string) (Store, error) {
	dbHandle := provider.dbProvider.GetDBHandle(ledgerID)
	return &store{db: dbHandle, ledgerID: ledgerID}, nil
}
868811
func NewInMemStore() Store {
	return &inmem{
		idgen: snowflake.NewIDGenerator(),
		meta:  map[platform.ID]StoreTaskMeta{},
	}
}
1278130
func NewFileStore(path string, fs utilfs.Filesystem) (Store, error) {
	if err := ensureDirectory(fs, path); err != nil {
		return nil, err
	}
	return &FileStore{directoryPath: path, filesystem: fs}, nil
}