interfaces

package
v1.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2023 License: MIT Imports: 9 Imported by: 1

Documentation

Overview

Package interfaces provides functions to retrieve information about interfaces in a Golang project

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InterfaceInfo

type InterfaceInfo struct {
	Package string `json:"package"` // package name where the interface is declared
	File    string `json:"file"`    // file name where the interface is declared
	Name    string `json:"name"`    // interface name
	Methods int    `json:"methods"` // number of method in this interface
}

InterfaceInfo represents general information about a specific interface

type InterfaceMetrics

type InterfaceMetrics struct {
	AverageMethods      float64         `json:"average_methods"` // average number of methods declared in all the interfaces
	InterfaceMaxMethods []InterfaceInfo `json:"max_methods"`     // interfaces which declares the max number of methods
	InterfaceMinMethods []InterfaceInfo `json:"min_methods"`     // interfaces which declares the min number of methods
}

InterfaceMetrics represents general metrics about interfaces in a Golang project

func ResolveInterfaceMetrics

func ResolveInterfaceMetrics(prj *project.ProjectInfo) (*InterfaceMetrics, error)

ResolveInterfaceMetrics retrieves metrics about interfaces in the provided Golang project.

An error is returned when it's not possible to get the packages information

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL