github.com/cs3org/reva/v2@v2.27.7/pkg/app/registry/micro/micro.go (about)

     1  // Copyright 2018-2021 CERN
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  //
    15  // In applying this license, CERN does not waive the privileges and immunities
    16  // granted to it by virtue of its status as an Intergovernmental Organization
    17  // or submit itself to any jurisdiction.
    18  
    19  package micro
    20  
    21  import (
    22  	"strings"
    23  
    24  	"github.com/cs3org/reva/v2/pkg/app/registry/registry"
    25  )
    26  
    27  const defaultPriority = "0"
    28  
    29  func init() {
    30  	registry.Register("micro", New)
    31  }
    32  
    33  type mimeTypeConfig struct {
    34  	MimeType      string `mapstructure:"mime_type"`
    35  	Extension     string `mapstructure:"extension"`
    36  	Name          string `mapstructure:"name"`
    37  	Description   string `mapstructure:"description"`
    38  	Icon          string `mapstructure:"icon"`
    39  	DefaultApp    string `mapstructure:"default_app"`
    40  	AllowCreation bool   `mapstructure:"allow_creation"`
    41  }
    42  
    43  // use the UTF-8 record separator
    44  func splitMimeTypes(s string) []string {
    45  	return strings.Split(s, "␞")
    46  }
    47  
    48  func joinMimeTypes(mimetypes []string) string {
    49  	return strings.Join(mimetypes, "␞")
    50  }