Documentation
¶
Index ¶
- Constants
- Variables
- func BasicAuthMiddleware(user, pass, realm string) endpoint.Middleware
- func DecodeAddRequest(_ context.Context, r *http.Request) (interface{}, error)
- func DecodeDeleteRequest(_ context.Context, r *http.Request) (interface{}, error)
- func DecodeFindRequest(_ context.Context, r *http.Request) (interface{}, error)
- func DecodeListRequest(_ context.Context, r *http.Request) (interface{}, error)
- func DecodePlistRequest(_ context.Context, r *http.Request) (interface{}, error)
- func EncodeJsonResponse(_ context.Context, w http.ResponseWriter, response interface{}) error
- func EncodePlistResponse(_ context.Context, w http.ResponseWriter, response interface{}) error
- func LoggingMiddleware(logger log.Logger, name string, debug bool) endpoint.Middleware
- func MakeAddEndpoint(srv Service, uploadDisabled bool) endpoint.Endpoint
- func MakeDeleteEndpoint(srv Service, enabledDelete bool) endpoint.Endpoint
- func MakeFindEndpoint(srv Service) endpoint.Endpoint
- func MakeGetDeleteEndpoint(srv Service, enabledDelete bool) endpoint.Endpoint
- func MakeListEndpoint(srv Service, uploadDisabled bool) endpoint.Endpoint
- func MakePlistEndpoint(srv Service) endpoint.Endpoint
- func NewInstallPlist(app *Item) ([]byte, error)
- type AppInfo
- type AppInfoType
- type AppList
- type Item
- type Package
- type Reader
- type Service
- type ServiceMiddleware
Constants ¶
View Source
const ( AppInfoTypeIpa = AppInfoType(0) AppInfoTypeApk = AppInfoType(1) AppInfoTypeUnknown = AppInfoType(-1) )
Variables ¶
View Source
var (
ErrIdInvalid = errors.New("id invalid")
)
View Source
var (
ErrIdNotFound = errors.New("id not found")
)
Functions ¶
func BasicAuthMiddleware ¶
func BasicAuthMiddleware(user, pass, realm string) endpoint.Middleware
func DecodeAddRequest ¶
func DecodeDeleteRequest ¶
func DecodeFindRequest ¶
func DecodeListRequest ¶
func DecodePlistRequest ¶
func EncodeJsonResponse ¶
func EncodeJsonResponse(_ context.Context, w http.ResponseWriter, response interface{}) error
func EncodePlistResponse ¶
func EncodePlistResponse(_ context.Context, w http.ResponseWriter, response interface{}) error
func LoggingMiddleware ¶
func MakeDeleteEndpoint ¶
func MakeFindEndpoint ¶
func MakeGetDeleteEndpoint ¶
func MakePlistEndpoint ¶
func NewInstallPlist ¶
Types ¶
type AppInfo ¶
type AppInfo struct {
ID string `json:"id"`
Name string `json:"name"`
Version string `json:"version"`
Identifier string `json:"identifier"`
Build string `json:"build"`
Channel string `json:"channel"`
Date time.Time `json:"date"`
Size int64 `json:"size"`
NoneIcon bool `json:"noneIcon"`
Type AppInfoType `json:"type"`
// Metadata
MetaData map[string]interface{} `json:"metaData"`
// store name
StorageName string `json:"storageName"`
}
func NewAppInfo ¶
func NewAppInfo(i Package, t AppInfoType) *AppInfo
func (*AppInfo) IconStorageName ¶
func (*AppInfo) PackageStorageName ¶
type AppInfoType ¶
type AppInfoType int
func FileType ¶
func FileType(n string) AppInfoType
func (AppInfoType) StorageName ¶
func (t AppInfoType) StorageName() string
type Item ¶
type Item struct {
// from AppInfo
ID string `json:"id"`
Name string `json:"name"`
Date time.Time `json:"date"`
Size int64 `json:"size"`
Channel string `json:"channel"`
Build string `json:"build"`
Version string `json:"version"`
Identifier string `json:"identifier"`
MetaData map[string]interface{} `json:"metaData"`
MetaDataFilter []string `json:"metaDataFilter"`
// package download link
Pkg string `json:"pkg"`
// Icon to display on iOS desktop
Icon string `json:"icon"`
// Plist to install ipa
Plist string `json:"plist,omitempty"`
// WebIcon to display on web
WebIcon string `json:"webIcon"`
// Type 0:ios 1:android
Type AppInfoType `json:"type"`
Current bool `json:"current"`
History []*Item `json:"history,omitempty"`
}
Item to use on web interface
type Service ¶
type Service interface {
List(publicURL string, uploadDisabled bool) (map[string]interface{}, error)
Find(id string, publicURL string) (*Item, error)
History(id string, publicURL string) ([]*Item, error)
Delete(id string) error
Add(r Reader, size int64, t AppInfoType) (*AppInfo, error)
Plist(id, publicURL string) ([]byte, error)
}
type ServiceMiddleware ¶
Click to show internal directories.
Click to hide internal directories.